Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: Write a program that will sort a basket of clothes into their proper drawers. Ifyou were not aware you are sort clothes by their

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribed

image text in transcribed

image text in transcribed

Objective: Write a program that will sort a basket of clothes into their proper drawers. Ifyou were not aware you are sort clothes by their type in this order: - Top Drawer-Undergarments Next Drawer -Socks or Stockines The Following Drawer Tops The Subsequent Drawer Bottoms The Cape Drawcr- Capes Write a class called Clothing Instance Variables o Type This can only be Undergarment, Socks, Stockings, Top, Bottom, and Cape o Color-This can only be Brown, Red, Pink, Orange, Green, Blue, Purple, and Grey o Dcfault o Parameterized o Make sure to check for valid values in the mutator o toString: Takes in no parameters and returns a string with the Type and Color of the garment .Accessors and Mutators for the instance variables . Methods o equals: Takes an instance of Clothing as a parameters and returns true only if the parameters are equal Next write a class called Dresser . Instance Variables o Clothes- a 2D array where there are only 5 drawers, and each drawer can hold 10 items of clothing o Just default that creates the 2D array No Accessors or Mutators . Methods o add: Takes in an instance of Clothing as a parameter and returns nothing. The parameter is then sorted in their proper drawers by its type as mentioned above. If a drawer is full make sure to tell the user. o remove: Takes in an instance of Clothing as a parameter and returns nothing. This method searches for a piece of clothing, and if it exists it is removed (by setting that value to null) o print: This prints out every piece of clothing in the dresser

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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

1. Identify what positions are included in the plan.

Answered: 1 week ago

Question

2. Identify the employees who are included in the plan.

Answered: 1 week ago

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago