Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: HTML
Posted by: Ovidio Lozano
Added: Apr 17, 2019 4:45 AM
Views: 11
Tags: no tags
  1. import java.util.Scanner;
  2. public class Main {
  3.  
  4.     static Scanner lector = new Scanner (System.in);
  5.     static double grados;
  6.    
  7.  
  8.     public static void main(String[] args)
  9.     {
  10.         System.out.println("Introduce ºC");
  11.         grados = lector.nextDouble();
  12.         // hacemos los calculos
  13.         double farenheit=grados*2-grados/5;
  14.         farenheit=farenheit+32;
  15.         // mostramos el resultado      
  16.         System.out.println(grados+" ºC equivale a "+farenheit+" farenheit");
  17.     }
  18. }
  19.