Question
JAVA question: Write two programs a class FreezingPoint.java (70 points) and a TestFreezingPoint.java (30 points). Part1: The following table lists the freezing and boiling points
JAVA question:
Write two programs a class FreezingPoint.java (70 points) and a TestFreezingPoint.java (30 points).
Part1:
The following table lists the freezing and boiling points of several substances
Substance Freezing Point Boiling Point
Ethyl Alcohol -173 172
Oxygen -362 -306
Water 32 212
Design a class FreezingPoint.java that stores a temperature in a temperature field and has the appropriate accessor(get) and mutator(set) methods for the field (10 points).
In addition the class should have the following methods:
isEthylFreezing this method 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. (10 points)
isEthylBoiling this method 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. (10 points)
isOxygenFreezing this method 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. (10 points)
isOxygenBoiling this method 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. (10 points)
isWaterFreezing this method 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. (10 points)
isWaterBoiling this method 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. (10 points)
HINT: The snippet below for isEthylFreezing method.
public boolean isEthylFreezing()
{
boolean status;
if (temperature <= -173.0)
status = true;
else
status = false;
return status;
}
Part2:
TestFreezingPoint.java will ask the user to enter a temperature, and then displays a list of substances that will freeze at that temperature and those that 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. (20 points)
Use while loop. The program continues until the user decides to quit the game (10)
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