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...
Java Script Ask the user for a Fahrenheit temperature Write the code needed to convert a...
Java Script Ask the user for a Fahrenheit temperature Write the code needed to convert a Fahrenheit temperature into a Celsius temperature. Use an alert box to show the result Ask the user for a Celsius temperature Write a function to convert from Celsius to Fahrenheit; use an alert box to show the results Decide on two other conversions (meters to feet, pounds to kilos, other) Ask the user for numbers to be converted; be sure to tell them what...
Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin...
Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin Newton Your program should take a character which represents the temperature to convert from and a value to be converted to using the following specification: C - Celsius K - Kelvin N - Newton In addition your program should take in the following character to exit the program: X - eXit the program The numeric input for your program should be of type double....
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
JAVA Programming (Convert decimals to fractions) Write a program that prompts the user to enter a...
JAVA Programming (Convert decimals to fractions) Write a program that prompts the user to enter a decimal number and displays the number in a fraction. Hint: read the decimal number as a string, extract the integer part and fractional part from the string, and use the Rational class in LiveExample 13.13 to obtain a rational number for the decimal number. Use the template at https://liveexample.pearsoncmg.com/test/Exercise13_19.txt for your code. Sample Run 1 Enter a decimal number: 3.25 The fraction number is...
****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 program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton...
Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is : F=9/5*C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. The formula for the conversion from Celsius to Newton is C = 100/33*N N is the Newton Temperature and C is the Celsius temperature Your C++ program should prompt the user for a lower value...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT