Question: The following table lists the freezing and boiling points of several substances. Design a class that stores a temperature in a temperature field and has

The following table lists the freezing and boiling points of several substances. 

Substance Ethyl Alcohol Oxygen Water Freezing Point -173 -362 32 Boiling Point

Design a class that stores a temperature in a temperature field and has the appropriate accessor and mutator methods for the field. In addition to appropriate constructors, the class should have the following methods: 

IsEthylFreezing. This method should return the boolean value true if the temperature stored in the temperature field is at or below the freezing point of ethyl alcohol.
Otherwise, the method should return false.
IsEthylBoiling. This method should return the boolean value true if the temperature stored in the temperature field is at or above the boiling point of ethyl alcohol.
Otherwise, the method should return false.
IsOxygenFreezing. This method should return the boolean value true if the temperature stored in the temperature field is at or below the freezing point of oxygen.
Otherwise, the method should return false.
IsOxygenBoiling. This method should return the boolean value true if the temperature stored in the temperature field is at or above the boiling point of oxygen. Otherwise, the method should return false.
IsWaterFreezing. This method should return the boolean value true if the temperature stored in the temperature field is at or below the freezing point of water. Otherwise, the method should return false.
isWaterBoiling. This method should return the boolean value true if the temperature stored in the temperature field is at or above the boiling point of water. Otherwise, the method should return false.

Write a program that demonstrates the class. The program should ask the user to enter a temperature, and then display a list of the substances that will freeze at that temperature and those that will boil at that temperature. For example, if the temperature is –20 the class should report that water will freeze and oxygen will boil at that temperature.

Substance Ethyl Alcohol Oxygen Water Freezing Point -173 -362 32 Boiling Point 172 -306 212

Step by Step Solution

3.38 Rating (173 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

ANSWER import javautilScanner public class Temperature private ... View full answer

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 Starting Out With Java From Control Structures Questions!