
Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a Floating-point number for the temperature and a character for the scale: either 'C' for Celsius or 'F' for Fahrenheit. The class should have
Four Constructors: One for the number of degrees, one the scale, one for both the degrees and the scale, and a default constructor. For each of these constructors, assume zero degrees if no value is specified and Celsius if no scale is given.
Two accessor methods: One to return temperature in degrees Celsius, and the other to return it in degrees Fahrenheit.
Three set methods: one to set the number of degrees, one to set scale, and one to set both.
Three comparison methods: one to test weather two temperatures are equal, one to test whether one temperature is greater than another, and one to test whether one temperature is less than another.
Write a driver program that tests all the methods. Be sure to invoke each of the constructors, to include at least one true and one false case for each comparison method, and to test at least the following three temperature pairs for equality: 0.0 degrees C and 32.0 degrees F -40.0 degrees C and -40.0 degrees F, and 100 degrees C and 212 degrees F.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.