Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Temperature c++ program (Temperature.exe) that will hold a temperature in Fahrenheit and provide functions to get the temperature in Fahrenheit, Celsius, and Kelvin.

Write a Temperature c++ program (Temperature.exe) that will hold a temperature in Fahrenheit and provide functions to get the temperature in Fahrenheit, Celsius, and Kelvin. The program should have the following data field in the main() function: ftemp: a double that holds a Fahrenheit temperature. The program should have the following functions: setFahrenheit: The set Fahrenheit method accepts a Fahrenheit temperature (as a double) and stores it in the ftemp field. getFahrenheit: Returns the value of the ftemp field as a Fahrenheit temperature (no conversion required) getCelsius: Returns the value of the ftemp field converted to Celsius. Use the following formula to convert to Celsius: Celsius = (5/9) * (Fahrenheit - 32) getKelvin: Returns the value of the ftemp field converted to Kelvin. Use the following formula to convert to Kelvin: Kelvin = ((5/9) * (Fahrenheit - 32)) + 273.15 Initially, the program should first accept a Fahrenheit temperature (as a double) and stores it in the ftemp field. It should then call the appropriate functions mentioned above (passing it the ftemp value) to calculate and display the temperature in the following format (for example, if the temperature in Fahrenheit was -15): The temperature in Fahrenheit is -15.00 The temperature in Celsius is -26.11 The temperature in Kelvin is 247.04

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

What are their resources?

Answered: 1 week ago

Question

7. Determine what feedback is provided to employees.

Answered: 1 week ago