Question: Create a new project in Eclipse called Temperature. Within that project, define a class that represents a Temperature object. It should contain two instance variables.

Create a new project in Eclipse called Temperature. Within that project, define a class that represents a Temperature object. It should contain two instance variables. One variable will hold the current temperature and the other variable is used to indicate whether the temperature is maintained in Farenheit or Celsius. The temperature variable will be type double, and the other variable will be type char. Create public methods to get and set both of these variables.

Use the Riddle class as a model.

Create a driver class, TemperatureUser, that creates two instances of Temperature. The first instance will have a value of 70 degrees Farenheit and the second 32 degrees Celsius.

Upload your Java class files (Temperature.java and TemperatureUser.java)

Extra Credit: Review the description of the toString() method in the Object specification (http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html). This method is inherited from the Object superclass. Write a new toString() method for the Temperature class that displays the temperature on the console.

ANY HELP ON THIS ONE WILL BE GREATLY APPRECIATED! Thanks in Advance

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!