Computer Science, asked by anshumangiri, 1 month ago

Write a program to input the temperature in Celsius and convert it into Fahrenheit. If the
temperature is more than 98.6 °F then display "Fever" otherwise "Normal". Using BlueJ

Answers

Answered by XxZeeshanarshiALLHA
1

import java.io.*;

public class KboatTemperature

{

public static void main(String args[]) throws IOException {

InputStreamReader read = new InputStreamReader(System.in);

BufferedReader in = new BufferedReader(read);

System.out.print("Enter temperature in Celsius: ");

double cel = Double.parseDouble(in.readLine());

double far = 1.8 * cel + 32;

if (far > 98.6)

System.out.println("Fever");

else

System.out.println("Normal");

}

Answered by msarkarkghh
1

Answer:

import java.io.*;

public class Temperature

{

public static void main(String args[]) throws IOException {

InputStreamReader read = new InputStreamReader(System.in);

BufferedReader in = new BufferedReader(read);

System.out.print("Enter temperature in Celsius: ");

double celcius = Double.parseDouble(in.readLine());

double  fahrenheit= (9 * (celcius/5)) + 32;

if (fahrenheit> 98.6)

{

System.out.println("Fever");

}

else

{

System.out.println("Normal");

}

}

}

Similar questions