Question

In: Computer Science

Write a java program to convert Celsius degrees to Fahrenheit degrees the user enters degrees in...

Write a java program to convert Celsius degrees to Fahrenheit degrees

the user enters degrees in Celsius and the program Coverts the input to Fahrenheit using the following formula

T(°F) = T(°C) × 1.8 + 32

submit the source code

Design

output

Load:

1. Design (Pseudocode )

2. Source file (Java file, make sure to include comments)

3. Output file (word or pdf or jpig file)

Solutions

Expert Solution

Pseudocode :

Input temperature in Celsius

Calculate Fahrenheit temperature as F = C x 1.8 + 32

Print the temperature in Fahrenheit

Code :

import java.util.Scanner;
public class HelloWorld
{
// main function
public static void main(String []args)
{
// make an object of Scanner class
Scanner sc = new Scanner(System.in);
// input temperature in Celsius
float C = sc.nextFloat();
// convert to fahrenheit
float F = C*1.8f + 32f;
// display the result
System.out.println("Temperature in Fahrenheit = "+F);
}
}


Related Solutions

In Java: Write a program called F2C that allows the user to convert from degrees Fahrenheit...
In Java: Write a program called F2C that allows the user to convert from degrees Fahrenheit to degrees Celsius. The program should prompt for a temperature in Fahrenheit and output a temperature in Celsius. All calculations should be done in in ints, so be careful of truncation.
Write a program that displays a temperature conversion table for degrees Celsius and degrees Fahrenheit. The...
Write a program that displays a temperature conversion table for degrees Celsius and degrees Fahrenheit. The table should include rows for all temperatures between 0 and 100 degrees Celsius that are multiples of 10 degrees Celsius. Include appropriate headings on your columns. The formula for converting between degrees Celsius and degrees Fahrenheit can be found on the internet. Python 3
Write a JAVA program that displays a table of the Celsius temperatures and their Fahrenheit equivalents....
Write a JAVA program that displays a table of the Celsius temperatures and their Fahrenheit equivalents.  The formula for converting a temperature from Celsius to Fahrenheit is F = 9/ 5 C + 32 where F → Fahrenheit temperature C → Celsius temperature.  Allow the user to enter the range of temperatures in Celsius to be converted into Fahrenheit.  Your program must use a loop to display the values of the temperature conversions (see sample output). Sample...
Write a function in bash that takes an input temperature (Celsius or Fahrenheit) from the user...
Write a function in bash that takes an input temperature (Celsius or Fahrenheit) from the user converts that temperature Celsius to Fahrenheit, Fahrenheit to Celsius, Celsius to Kelvin and Fahrenheit to Kelvin
****USING BASH**** Write a function that takes an input temperature (Celsius or Fahrenheit) from the user...
****USING BASH**** Write a function that takes an input temperature (Celsius or Fahrenheit) from the user converts that temperature Celsius to Fahrenheit, Fahrenheit to Celsius, Celsius to Kelvin and Fahrenheit to Kelvin.
Instructions Write a program in C# that converts a temperature given in Fahrenheit to Celsius. Allow...
Instructions Write a program in C# that converts a temperature given in Fahrenheit to Celsius. Allow the user to enter values for the original Fahrenheit value. Display the original temperature and the formatted converted value. Use appropriate value returning methods for entering (input), calculating, and outputting results.
Write a java program that will ask for a Star Date and then convert it into...
Write a java program that will ask for a Star Date and then convert it into the corresponding Calendar date. without using array and methods.
Convert the boiling temperature of gold, 2966 °C, into degrees Fahrenheit and kelvin.
Convert the boiling temperature of gold, 2966 °C, into degrees Fahrenheit and kelvin.  
Write Java code that allows a user to repeatedly enter numbers. Each time the user enters...
Write Java code that allows a user to repeatedly enter numbers. Each time the user enters a number, the program should print out the average of the last 3 numbers (or all numbers if 3 or less have been entered). I would like a detailed explanation so that a beginner level Java programmer could understand.
Write a C++ program that reads numbers from the user until the user enters a Sentinel....
Write a C++ program that reads numbers from the user until the user enters a Sentinel. Use a Sentinel of -999. Ignore all negative numbers from the user input. Do the following: Output the sum of all even numbers Output the sum of all odd numbers Output the count of all even numbers Output the count of all odd numbers You must use loops and numbers to do this. You must not use any arrays or vectors for this program.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT