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

"Objective: Write a program that will sort a basket of clothes into their proper drawers. If you were not aware you are sort clothes by their type in this order: Top Drawer Undergarments, Next Drawer Socks or Stockings, The Following Drawer Tops, The Subsequent Drawer Bottoms, The Cape Drawer Capes"

I am having problems with my "remove" part of this problem. My add method works fine but the remove does not. Any idea what I am doing wrong? My code and the full prompt are below.

"Objective: Write a program that will sort a basket of clothes intotheir proper drawers. If you were not aware you are sort clothesby their type in this order: Top Drawer Undergarments, Next Drawer Socks

public void AddClothes(Clothing myGarment) i int i-0; for(Clothing_Type type: Clothing_Type.valuesO) E if(type--myGarment.getTypeO) ifci>l) int tempSpot = getVacantSpot(i); if(tempSpot !=-1) { this. clothesList[i][tempSpot] = myGarment; else System.out.printlnC"No space available. Try another drawer."); break; i-1 ; //Method to remove clothing public void RemoveClothes(Clothing myGarment) t for(int i-0;i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!