Computer Science, asked by simranrawat3666, 2 months ago

Write a program to input temperature in Celsius and convert it into Fahrenheit. If the temperature is more

than 98.6 F then display “Fever” otherwise “Normal”.



[ F=(9/5)*c+32]​

Answers

Answered by Falcon06
1

public class Pro{

public static void main ( String[] args ){

Scanner sc = new Scanner (System.in);

System.out.println("Enter 1 to input temparature in farenheit or 2 to enter in Celsius");

int ch = sc.nextInt( );

switch (ch){

case 1:

System.out.println("Enter temparature");

int temp = sc.nextint( );

if (temp > 98.6)

System.out.println("Fever");

else

System.out.println("Not Fever");

break;

case 2:

System.out.println("Enter temparature");

int temp = sc.nextint( );

temp = (9/5)*temp+32;

if (temp > 98.6 )

System.out.println("Fever");

else

System.out.println("Not Fever");

break;

}

}

}

Similar questions