Question
Exercise 4a). Write a program that creates two double variables called Fahrenheit and Celsius and that assigns the value 39 to the variable Celsius. The
Exercise 4a). Write a program that creates two double variables called Fahrenheit and Celsius and that assigns the value 39 to the variable Celsius. The program then computes the equivalent temperature in degrees Fahrenheit and assigns this value to a variable called Fahrenheit. (Find the formula on the Web.) The program then writes the correct result in the form [3 marks] 39.0 C = .. F. Change the program to have a value of -7.5 Celsius. Include both the outputs in this report. Do not concern yourself with controlling the display of the decimal point. Solution (program):
Output (2 output)
Exercise 4b). Write a program that creates two double variables called Fahrenheit and Celsius and that assigns the value 77.5 to the variable Fahrenheit. The program then computes the equivalent temperature in degrees Celsius and assigns this value to a variable called Celsius. (Find the formula on the Web.) The program then writes the correct result in the form [3 marks] 77.5 F = .. C. Change the program to have a value of 45.0 Fahrenheit. Include both the outputs in this report. Do not concern yourself with controlling the display of the decimal point. Solution (program):
Output (2 output)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started