Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

[Projeto] Celsius para Fahrenheit

public class TempFahrenheit {
    public static void main(String[] args) {
        double celsius = 45.1;
        double tempFahrenheit;
        tempFahrenheit = (celsius * 1.8) + 32;
        System.out.println(tempFahrenheit);
        int convertFahrenheit = (int) (tempFahrenheit);
        System.out.println(convertFahrenheit);
    }
}

código completo

public class TempFahrenheit {
    public static void main(String[] args) {
        double celsius = 45.1;
        double tempFahrenheit;
        tempFahrenheit = (celsius * 1.8) + 32;
        String mensagem = String.format("A temperatura em Celsius é de %.1f, enquanto em Fahrenheit é de %.1f.", celsius, tempFahrenheit);
        System.out.println(mensagem);

        int convertFahrenheit = (int) (tempFahrenheit);
        System.out.println("A temperatura inteira em Fahrenheit é de " + convertFahrenheit + ".");
    }
}

Matricule-se agora e aproveite até 50% OFF

O maior desconto do ano para você evoluir com a maior escola de tecnologia

QUERO APROVEITAR
1 resposta
solução!

legal amigo! parabéns!!!