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
import java.util.Scanner;
public class Temperature {
public static void main(String[] args) {
double tempFahrenheit;
Scanner sc = new
Scanner(System.in);
System.out.print("Enter the
temperature in Fahrenheit: ");
tempFahrenheit =
sc.nextDouble();
double tempCelcius =
(tempFahrenheit - 32) * 5 / 9.0;
System.out.println(tempFahrenheit +
" in Fahrenheit is " + tempCelcius + " in Celsius");
System.out.print("\n\nEnter the
temperature in Celcius: ");
tempCelcius =
sc.nextDouble();
tempFahrenheit = (32 + (tempCelcius
* 9 / 5.0));
System.out.println(tempCelcius + " in Celsius is " + tempFahrenheit + " in Fahrenheit");
}
}
====================
See Output
Thanks, let me know if there is any concern, Please rate if you
think its helpful
Convert Celsius to Fahrenheit. (Programming Exercise 2.1) or Convert Fahrenheit to Celsius. Write a program with...
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.
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....
Exercise 5.4 The following program is supposed to convert a temperature in degree Fahrenheit to degree Celsius, but it will not produce the correct result. Use type casting to fix the problem and run the program for the test values. Call your new program ex54.cpp. Test cases: 32 F is 0 C 212 F is 100 C PROGRAM: #include using namespace std; int main( ) { int t_in_fah, t_in_cel; //Notice that we declared these two as integers, not the best...
8.) Write a C++ program to convert temperature in degrees Fahrenheit to degrees Celsius. This is the equation for this conversion: Celsius = 5.0/9.0 (Fahrenheit-32.0) Have your program convert and display the Celsius temperature corresponding to 98.6 degrees Fahrenheit. Your program should produce the following display (replacing the underlines with the correct values): For a Fahrenheit temperature of-_ degrees, the equivalent Celsius temperature is degrees
# convert.py # A program to convert Celsius temps to Fahrenheit # by: Susan Computewell def main(): celsius = eval(input("What is the Celsius temperature? ")) fahrenheit = 9/5 * celsius + 32 print("The temperature is", fahrenheit, "degrees Fahrenheit.") main() PORTION ONE: Based the convert.py, so it can convert temperatures from Fahrenheit to Celsius, instead of original Celsius to Fahrenheit. Make sure to change the message to reflect the change of introduction and final result. Name it as: convert_v2.py. Run it...
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.
i need a python code For an exact conversion between "Fahrenheit temperature scale" and "Celsius temperature scale", the following formulas can be applied. Here, F is the value in Fahrenheit and the value in Celsius: Temperature Conversions C = 5 9 (F - 32) F = (š xc) + 3 Write a Python program that uses the above formula to convert Celsius to Fahrenheit and vice versa. We ask user to input "Enter a degree: ", and then we get...
Write a program that asks the user to enter a temperature in Celsius, and then computes and displays the equivalent Fahrenheit temperature.It should use a QInputDialog to get the value from the user, and a QMessageBox to display the result.
IN JAVA: 1. Write a program to convert 40 degrees to 94 degrees Fahrenheit to Celsius (USE FOR LOOP) 2. Print the odd numbers from 1 to 100 (USE FOR LOOP)
C++ optional exercise. You are going to convert temperatures in this program. You will give the user the choice of converting Fahrenheit to Celsius or Celsius to Fahrenheit. With the correct answer you will also display the number entered. The user should have the option to convert as many temperatures as they want. Use functions and a menu (also a function) and, assume they will convert at least one temperature. When finished upload and submit the zipped project. the formulas...