-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path07.java
29 lines (17 loc) · 1.09 KB
/
07.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*****************************************************************************************************************
* 7) Ler uma temperatura em graus Fahrenheit e apresentá-Ia convertida em graus Celsius. A fórmula de conversão de
* temperatura a ser utilizada é C = (F - 32) * 5 / 9, em que a variável F é a temperatura em graus Fahrenheit e a
* variável C é a temperatura em graus Celsius.
*****************************************************************************************************************/
import java.util.Scanner;
public class Exercicio{
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
double Celsius, Fahrenheit; //Consegui colocar o nome de variável mais difícil do mundo! o/
System.out.print("Conversor de temperatura: Graus Fahrenheit -> Graus Celsius\n\n"); //é basicamente uma cópia do exercício anterior
System.out.print("Digite a temperatura em Fahrenheit: ");
Fahrenheit = entrada.nextDouble();
Calsius = (Fahrenheit - 32 ) * 5 / 9;
System.out.print("\n A medida convertida é " + Calsius + "ºC\n");
}
}