Search Blog

Miyerkules, Pebrero 6, 2013

Write an application that inputs temperature in Celsius and prints out the temperature in Fahrenheit. The formula to convert Celsius to the equivalent Fahrenheit is ------> Fahrenheit = 1.8 x Celsius + 32

Java Codes
--+o0O0o+--


import java.util.Scanner;

public class MachineProblemB1 {

    public static void main(String[] args) {

        Scanner input_user = new Scanner(System.in);
       
        double Celsius,Fahrenheit;
              System.out.println("==========================================");
System.out.println("||  Celsius to Fahrenheit Converter     ||");        System.out.println("==========================================");
       
        System.out.print(" Enter temperature in Celsius:      ");
        Celsius = input_user.nextDouble();
       
        Fahrenheit = 1.8 * Celsius + 32;
       
        System.out.println("*****************************************");
System.out.println("  Fahrenheit : " + Fahrenheit);
System.out.println("*****************************************");
    }
}