Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Freezer class (Freezer.java and FreezerTester.java) Design a class named Freezer to represent a freezer to store frozen food. This class contains: Three constants named SLOW,

Freezer class (Freezer.java and FreezerTester.java) Design a class named Freezer to represent a freezer to store frozen food. This class contains: Three constants named SLOW, MEDIUM, and FAST with the value 1 ,2, and 3 to denote the freezing speed. A private int data field named temperature in Fahrenheit (between 0 and 32) that specifies the temperature of the freezing temperature (the default is 0). A private boolean data field named on that specifies whether the freezer is on(the default is false). A private double data field named size (in cubit feet) that specifies the size of the freezer (default is 3.0). A string data field named color that specifies the color of the freezer (the default is black). The accessor and mutator methods for all four data fields. A no-arg constsructor that crates a default freezer. A method name toString() that returns a string description for the freezer. If the freezer is on, the method returns the freezers freezing speed, color, and size in one combined string. If the freezer is not on, the method returns the freezer color and size along with the The freezer is currently off in one combined string. Write a test program that creates two Freezer objects. Assign maximum speed, size 28.5 cu.ft, color red, and turn it on to the first object. Assign medium speed, size 19.5 cu.ft., color StainlessSteel, and turn it off to the second object. Display the object by invoking their toString method.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Briefly identify the regulatory options for a natural monopoly.

Answered: 1 week ago