Question: Temperature - temperature: double - scale: char // C for Celsius, F for Fahrenheit, K for Kelvin, default is F + Temperature(temperature: double) + Temperature(temperature:

Temperature

- temperature: double

- scale: char // C for Celsius, F for Fahrenheit, K for Kelvin, default is F

+ Temperature(temperature: double)

+ Temperature(temperature: double, scale: char)

+ toCelsius(): void // changes current temperature member variable to Celsius

+ toFahrenheit(): void // changes current temperature member variables to Fahrenheit

+ toKelvin(): void // changes current temperature member variable to Kelvin

+ setTemperature(temperature: double):void

+ setScale(scale:char):void

+ getTemperature(): double

+ getScale(): char

+ toString(): string

Build the Class, the testClass and test temperature object for all possible scales.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!