Computer Applications
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".
Java
Input in Java
68 Likes
Answer
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");
}
}
Output
Answered By
22 Likes
Related Questions
A shopkeeper announces two successive discounts 20% and 10% on purchasing of goods on the marked price. Write a program to input marked price and calculate the selling price of an article.
'Mega Market' has announced festival discounts on the purchase of items, based on the total cost of the items purchased:
Total cost Discount Up to ₹2,000 5% ₹2,001 to ₹5,000 10% ₹5,001 to ₹10,000 15% Above ₹10,000 20% Write a program to input the total cost. Display name of the customer, discount and the amount to be paid after discount.
Write a program to input two unequal numbers. Display the numbers after swapping their values in the variables without using a third variable.
Sample Input: a=23, b= 56
Sample Output: a=56, b=23Write a program to accept marks of a student obtained in 5 different subjects (English, Phy., Chem., Biology, Maths.) and find the average. If the average is 80% or more then he/she is eligible to get "Computer Science" otherwise "Biology".