• Lenguaje

    Java usando Scanner

  • Descripción

    Convierte grados Celsius a grados Fahrenheit.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import java.util.Scanner;

public class GradosCelsiusAFahrenheit {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double grados_celsius, grados_fahrenheit;
        System.out.print("Ingresa el valor de grados celsius: ");
        grados_celsius = in.nextDouble();
        in.nextLine();
        grados_fahrenheit=1.8*grados_celsius+32;
        System.out.println("Valor de grados fahrenheit: " + grados_fahrenheit);
    }

}