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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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