Question

Write a Java program that converts Centigrade temperatures to Fahrenheit temperatures. The formula is F =...

Write a Java program that converts Centigrade temperatures to Fahrenheit temperatures. The formula is F = 9/5C + 32

F is the Fahrenheit temperature and C is the centigrade temperature.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import java.util.Scanner;

public class TemperatureConverter {

public static void main(String[] args) {

Scanner in = new Scanner(System.in);
  
/* Input temperature in Celsius from user */
System.out.println("Enter temperature in Celsius: ");
float C = in.nextFloat();
  
/* Convert Celsius to Fahrenheit */
float F = C*(9/5)+ 32;
  
/* Print result */
System.out.println(C + " degree Celsius is equal to " + F +" degree Fahrenheit.");

}
}

Add a comment
Know the answer?
Add Answer to:
Write a Java program that converts Centigrade temperatures to Fahrenheit temperatures. The formula is F =...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In Python, write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as...

    In Python, write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=(9/5)C+32 The program should ask the user to enter a temperature in Celsius, then display the temperature converted to Fahrenheit.

  • Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=95C+32...

    Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=95C+32 The program should ask the user to enter a temperature in Celsius, and then display the temperature converted to Fahrenheit. I'm doing this on Python.

  • Write a program that inputs Celsius temperatures (use a void function), converts them to Fahrenheit (f...

    Write a program that inputs Celsius temperatures (use a void function), converts them to Fahrenheit (f = 9/5C + 32, use a value returning function) and prints whether it is a day for swimming or skiing (use a function). Include a loop in main that quits looping on -999. code in C++ please include a screen shot of the code as it is easier to read

  • write program in java 5. Falling Distance When an object is falling because of gravity, the...

    write program in java 5. Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d = 1/2 gta The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, that the object has been falling. Write a method named fallingDistance that accepts an object's falling time...

  • Intro To Java Class. AS SIMPLE AS POSSIBLE. Please post the pic of code, will up...

    Intro To Java Class. AS SIMPLE AS POSSIBLE. Please post the pic of code, will up Vote! You will need to use Blue) for the following questions. Although these are programming exercises, remember always that the first step to the program is to put your ideas on paper to organize your thoughts. Remember Section 1.6: The Programming Process. Centigrade to Fahrenheit Table Write a program that displays a table of the centigrade temperatures 0 through 20 and their Fahrenheit equivalents....

  • Java program Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit....

    Java program Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating- point number for the temperature and a character for the scale, eitherでfor Celsius or 'F' for fahrenheit. The class should have Four constructors: one for the number of degrees, one for the scale, one for both the degrees and scale, and a default constructor. For each of these constructors, assume zero degrees if no value is specified and celsius if no...

  • assignment 1 Make sure you are able to write a python program as described in the...

    assignment 1 Make sure you are able to write a python program as described in the text. You will be working in repl.it Title your program temperature. Add a comment to say that this program converts Fahrenheit to Centigrade. Create variables: fahrenheit and centigrade values my name Have the program prompt the user (the instructor) for a value for the fahrenheit variable. Convert the value to centigrade, using this formula: (fahrenheit - 32) * ÷ 9 = centigrade Have the...

  • Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and converts...

    Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and converts it to Celsius by subtracting 32 from the Fahrenheit value and multiplying the result by 5/9. Display both values to one decimal place. For example, if 88.5 degrees is input, the output would be: 88.5 F is 31.4 C Answer in C# (Posting incomplete code i have so far that wont run correctly.) using System; using static System.Console; class FahrenheitToCelsius { static void Main()...

  • Write a program that displays a table of Celsius temperatures 0 through a number entered by...

    Write a program that displays a table of Celsius temperatures 0 through a number entered by the user and their Fahrenheit equivalents as in the figure below. The formula for converting a Celsius temperature to a Fahrenheit temperature is: F = 9 / 5 * C + 32 where F is the Fahrenheit temperature and C is the Celsius Temperature. Your program must use a 'for' loop. Display all temperatures to one decimal place. Write a program that displays a...

  • Convert Celsius to Fahrenheit. (Programming Exercise 2.1) or Convert Fahrenheit to Celsius. Write a program with...

    Convert Celsius to Fahrenheit. (Programming Exercise 2.1) or Convert Fahrenheit to Celsius. Write a program with reads a Celsius degree value from the console or a Fahrenheit degree value from the console , then converts it to Fahrenheit or Celsius and displays the result. The formulas for the conversion are as follows: Fahrenheit = (9 / 5) * Celsius + 32 Celsius = (5/9) *(Fahrenheit -32) Write this program in Java please

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT