Question: Program 2 Objective: For this programming assignment, you will design a C + + class called Temperature that handles temperatures in different scales ( Kelvin
Program Objective: For this programming assignment, you will design a C class called
Temperature that handles temperatures in different scales Kelvin Celsius, and Fahrenheit This
class will internally store the temperature in Kelvin and provide methods to set and get the
temperature in any of the three scales.
Class Design:
Private Member Variable:
double kelvin: to store the temperature value in Kelvin.
Public Member Functions:
setTempKelvindouble: Takes a temperature in Kelvin and stores it
setTempFahrenheitdouble: Takes a temperature in Fahrenheit, converts it to
Kelvin, and stores it
setTempCelsiusdouble: Takes a temperature in Celsius, converts it to Kelvin, and
stores it
getTempKelvin: Returns the temperature in Kelvin.
getTempFahrenheit: Converts the stored temperature to Fahrenheit and returns it
getTempCelsius: Converts the stored temperature to Celsius and returns it
Conversion Formulas:
To Kelvin:
From Celsius: Kelvin Celsius
From Fahrenheit: Kelvin Fahrenheit
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
