Question

Write Java applet which will ask the user to enter Temperature in Fahrenheit. Your code should...

Write Java applet which will ask the user to enter Temperature in Fahrenheit. Your code should convert it into Celcius and display the value to the user.

Homework Answers

Answer #1
//FahrenheitToCelsius.java
import java.util.Scanner;
public class FahrenheitToCelsius {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter temperature in Fahrenheit: ");
        double fahrenheit = scanner.nextDouble();
        double celsius = (fahrenheit-32)*(5.0/9.0);
        System.out.println("Temperature in celsius = "+celsius);
    }
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a java code that ask user to enter the time they clock in for work,...
Write a java code that ask user to enter the time they clock in for work, and out for work and calculate their total hours for each day. Calculate the total hours for all five days. If the total hours is > or >= 12 then they are awesome, if not they are lazy. Thank you
Using Python, write the following code. You are to allow the user to enter the daily...
Using Python, write the following code. You are to allow the user to enter the daily temperature as a floating-point number. You should make the assumption that you are recording temperatures in Fahrenheit. You should allow the user to continue entering temperatures until the value -999 is entered. This number should not be considered a temperature, but just a flag to stop the program. As the user enters a temperature, you should display the following each time: Current Temperature: 999...
Write an applet and design an interface which will accept miles and convert to kilometers and...
Write an applet and design an interface which will accept miles and convert to kilometers and display the result when calculate button is pressed. Pls write code in java
Classwork_1.5: Write a C code that ask the user to enter the name of person, gender...
Classwork_1.5: Write a C code that ask the user to enter the name of person, gender (male or female) and age and display these quantities. You need to create a structure to solve this problem. Output:
C++ Fahrenheit to Celsius Tables Write a program that first asks the user which Temperature scale...
C++ Fahrenheit to Celsius Tables Write a program that first asks the user which Temperature scale conversion he/she would like to perform: 1. Convert F to C 2. Convert C to F 3. Quit What is your choice? Then it asks the user for input for three real number variables: start_temp, end_temp, temp_incr. It will then produce a two column Fahrenheit to Celsius table or a two column Celsius to Fahrenheit table, depending on the choice. For choice 1, the...
Write a java program that asks for temperature in Fahrenheit. The program should accept any floating...
Write a java program that asks for temperature in Fahrenheit. The program should accept any floating point number. Display whether water is liquid, solid, or gas at that temperature at sea level. Display the results like this: “Water at that temperature is a solid/liquid/gas.” (Note: display only the correct state for that temperature.) water freezes at 32 degrees F and boils at 212 degrees F.
A. Write a Java program that asks the user to enter “bus” or “subway” or “walk”....
A. Write a Java program that asks the user to enter “bus” or “subway” or “walk”. If the user enters “bus” display “$1.00”. If they enter “subway” display “$1.50 and if they enter “walk” display “Free”. B. Write a java program that creates the following two arrays: String[] candidates = {“S Jones”,”Justin Fairfax”,”Clark Duncan”}; int[] votes = {7345,4324,3211}; Write the code that will search the votes array for the candidate with the largest number of votes and prints the name...
Write a powershell script which will ask the user to enter a number. If the answer...
Write a powershell script which will ask the user to enter a number. If the answer is not equal to 10 display message "Congratulations".
I need to write a function in python that will take user input of temperature in...
I need to write a function in python that will take user input of temperature in degrees Celcius and convert it into degrees Fahrenheit. I am familiar with C++ but not python.
Write the C++ language statements to ask a user to enter a number within the range...
Write the C++ language statements to ask a user to enter a number within the range of 0 to 100 (0 and 100 are valid inputs). When the value is not valid, you should prompt the user to enter another value. (The user may enter many invalid numbers, so you must use loop). Only after the user enters a valid number should you display the message “Good” and the value of the number.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT