Write a program that will sort a basket of clothes

Assignment Help Programming Languages
Reference no: EM132211469

Quesiton: 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

Write a class called Clothing

Instance Variables

Type - This can only be Undergarment, Socks, Stockings, Top, Bottom, and Cape

Color - This can only be Brown, Red, Pink, Orange, Green, Blue, Purple, and Grey

Constructors

Default

Parameterized

Accessors and Mutators for the instance variables

Make sure to check for valid values in the mutator

Methods

toString: Takes in no parameters and returns a string with the Type and Color of the garment

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

Clothes - a 2D array where there are only 5 drawers, and each drawer can hold 10 items of clothing

Constructors

Just default that creates the 2D array

No Accessors or Mutators

Methods

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.

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).
print: This prints out every piece of clothing in the dresser

Finally write a class called DresserFrontEnd

Contains the main method

Prompts the user to add clothing, remove clothing, check what is in the dresser, or quit

Adding an item should prompt the user to enter the type and color

Removing should prompt the user to again enter the type and color they wish to remove

Printing shows the user what is in the dresser

Quit immediately halts the program

Reference no: EM132211469

Questions Cloud

Write a program for alphabetic characters : Write a program that requests the user to enter an alphabetic character. Then convert the character from upper case to lower case or lower case to upper case.
Explain how and why the overflow flag was affected : Explain how and why the Overflow flag was affected by each instruction in microprocessor Assembly Language.
Define two public member functions which can be used : Define two public member functions which can be used for inputting data and for showing output of entered data.
Write a program that takes a dollar amount as a string input : Write a program that takes a dollar amount (...XXX.XX) as a string input and inserts commas every three digits if the number is large.
Write a program that will sort a basket of clothes : 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.
Critically health and safety policy in place : NT 2065 Health and Safety in the Workplace - B.Sc. (Hons) Health, Safety and Environmental Management - Evaluate critically health and safety policy in place
Generate the table only when the button is pressed : Write a program, using either a for-loop, that when a button is clicked on the first page, a function is called that writes a html table of Celsius temperatures
Write a program that will take integers from the user : Write a program that will take 7 integers from the user, store them in an array. Write three functions which takes the aforementioned array as input.
Write a program that takes in a string from the user : Write a program that takes in a string from the user. Count the number of consonants, vowels, digits and "other" characters in the string.

Reviews

Write a Review

Programming Languages Questions & Answers

  Describe issues-web site designers when adding multimedia

Describe some of the issues web site designers must consider when adding multimedia to a web site. Consider issues such as bandwidth, server load, or others you consider to be important. Please provide references.

  Display the sine cosine and tangent of the angle

Write a program that asks the user for an angle, entered in radians. The program should then display the sine, cosine, and tangent of the angle

  Write program which bounces blue ball inside jpanel

Write a program which bounces blue ball inside a JPanel. The ball must begin moving with a mousePressed event. When the ball hits the edge of the JPanel.

  Write looping structure pseudocode accepting employee data

Write looping structure pseudocode which prompts user for employee data; application continues to accept data for new employees until user enters 0 for ID number to indicate desire to quit.

  Create a new C++ project in Visual Studio

Create a new C++ project in Visual Studio. (Scroll down for Mac version of this exercise.) Copy and paste this program into Visual Studio

  Allows the user to enter the cost for an item

Write a program that allows the user to enter the cost for an item and the number of that item ordered.

  Find ultimate gain and period of a proportional controller

You are asked to model three mixing tanks in series. Find the ultimate gain and period of a proportional controller that is to control the outlet composition.

  Write program to evaluate young worker-s earning

Write down a program to evaluate how much young worker will make before retiring at age 65. Request worker's name, age, and starting salary as input.

  Create an object-oriented application to handle inventory

Working at the GMU Used Car Dealership, you need to create an object-oriented application to handle inventory. To start, you create a detailed UML diagram that helps to plan your solution.

  What is a virtual function and what is its purpose

What is a virtual function? What is its purpose? What is the difference between a virtual and a pure virtual function? What is an abstract class, and what is its purpose?

  Draw a gui to create objects

Draw a GUI that will create the objects and provide access to each object's processing methods. Use the drawing tool in Microsoft Word.

  Write a small driver class called testemployee

ITECH1000/5000 Programming Assignment.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd