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
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