Question
Create an interface called edu.udc.cs2.MachineWashable Add 1 interface method: public int getMaxTemp(); MachineWashable must not extend any other interfaces Finally, create a class called edu.udc.cs2.Cleaners.
Create an interface called edu.udc.cs2.MachineWashable
Add 1 interface method:
public int getMaxTemp();
MachineWashable must not extend any other interfaces
Finally, create a class called edu.udc.cs2.Cleaners. In this class create a void static method called washLaundry that takes a Set of Clothing as the only parameter.
The method must do the following. Iterate the passed-in set of Clothing and output one of 3 statements below for each Clothing element:
If the item is a MachineWashable, output:
itemName is a cold water item.
if the getMaxTemp() is 90 or below where itemName is the value returned by getItemName()
if the max temp is not 90 or below, output:
itemName is a hot water item.
if the item is not MachineWashable, output
itemName is not machine washable.
Be very careful on the spelling and package names as testing your code will rely on the spelling and packages laid forth in this assignment.
Turn in ONLY 2 files:
MachineWashable and Cleaners.java
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