In this question we will be designing an application to make outfit suggestions.
ID: 666599 • Letter: I
Question
In this question we will be designing an application to make outfit suggestions. Your first step
is to define the classes to represent the clothing items you will need along with constructors,
attributes, and getters/setters as appropriate . You will need base classes for at
least the following:
• Shirts (t-shirts, sweaters, button-up shirts, turtlenecks, etc.)
• Pants (jeans, khakis, slacks, capris, shorts, etc.)
• Outerwear (spring coat, winter jacket, etc.)
• Shoes (dress shoes, running shoes, steel-toed boots, etc.)
• Accessories (rings, earrings, watches, ties, etc.)
For each of these base classes you will be expected to implement a number of sub classes that
inherit from these base classes. For example, you may make a Shirt class that has Tshirt,
Sweater, ButtonUpShirt, etc as sub-classes. Make sure you represent enough clothing items
that your outfit planner can actually suggest a reasonable number of different combinations
of outfits. If you get to the end of the program and find you need more, just come back and
add new items.
In each of your clothing/accessory classes, write methods that have no parameters and return
boolean values. These methods will ask various questions about the clothing/ accessory item,
like whether it is plain or colourful, fancy or casual, good with earrings, good with dress
shoes, etc. (add your own characteristics, too!) . These will be used to determine
what combinations of clothing do not make a good outfit. It is important that the base
class(es) for each category of clothing/accessory have these methods as well, perhaps as
abstract methods, so that you can store lists using the base class types and call the methods
without casting.
Next, you will create a class (or classes) that will take care of generating good outfit suggestions. Inside, store lists for the following clothing/accessory types :
• Shirts
• Pants
• Outerwear
• Shoes
• Accessories
The lists will store a base class type, but you will be able to add that type of object and any
subclasses of the base class to the list. As long as the base class has the necessary methods
defined (i.e., the characteristic methods from the previous step), polymorphism will allow
you to use the objects correctly without casting back to their original types. You are expected to have a relatively large number of objects stored in this outfit generating class.
Ensure you have a good number of objects from each category with a total of at least 30
objects stored across the five lists.
Add a method (or methods) that will take one item from each of the five above types stored
in the lists and decide whether it makes a good outfit. Use the characteristic
methods you defined earlier to check whether the given combination is good. Here are some
ideas for rules you could apply (as usual, add your own as well):
• The shirt, pants, and shoes should not all be plain
• A shirt that is not good with dress shoes shouldnt be worn with dress shoes
• A winter jacket shouldnt be worn with shorts
• A tie shouldnt be worn with jeans
• Blue and green together should be avoided
Add a method (or methods) that generate outfit possibilities by randomly choosing an item
from each of the five categories, testing the combination with the rules you created above,
and repeating until a good combination is found .
Add a testing class and test all of your methods, including printing out several of the combinations your outfit generator comes up with .
Explanation / Answer
//java program for Outfit suggestions, I have written some code with abstract classes but missing about other classes is specify properties and method name so that code can be completed
import java.util.Scanner; //for reading values
class Shirts
{
//code here
boolean colorful,plain;
boolean casual,fancy;
abstract boolean isColorFull();
abstract boolean isRegular();
abstract boolean isCasual();
abstract boolean isFancy();
}
class T_Shirts extends Shirts
{
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is T-Shirt is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It T-Shirt is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It T-Shirt casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It T-Shirt Fancy? : ");
fancy=s.next();
}
}
class Sweater extends Shirts
{
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is Sweater is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It Sweater is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It Sweater casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It Sweater Fancy? : ");
fancy=s.next();
}
}
class Bottom_Up_Shirts extends Shirts
{
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is Bottom_Up shirts is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It Bottom_Up shirts is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It Bottom_Up shirts casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It Bottom_Up shirts Fancy? : ");
fancy=s.next();
}
}
class TurtleNecks extends Shirts
{
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is Turtle necks is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It Turtle necks is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It Turtle necks shirts casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It Turtle necks shirts Fancy? : ");
fancy=s.next();
}
}
class Pants
{
//code here
boolean colorful,plain;
boolean casual,fancy;
abstract boolean isColorFull();
abstract boolean isRegular();
abstract boolean isCasual();
abstract boolean isFancy();
}
class Jeans extends Pants
{
//code here
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is Jeans is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It Jeans is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It Jeans casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It Jeans Fancy? : ");
fancy=s.next();
}
}
class Khakis extends Pants
{
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is Khakis is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It Khakis is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It Khakis casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It Khakis Fancy? : ");
fancy=s.next();
}
}
class Slacks extends Pants
{
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is Slacks is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It Slacks is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It Slacks casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It Slacks Fancy? : ");
fancy=s.next();
}
}
class Capris extends Pants
{
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is Capris is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It Capris is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It Capris casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It Capris Fancy? : ");
fancy=s.next();
}
}
class Shorts extends Pants
{
//code here
boolean isColorFull()
{
Scanner s=new Scanner(System.in);
System.out.println("Is Shorts is Colorful? : ");
colorful=s.nextBoolean();
}
boolean isRegular()
{
Scanner s=new Scanner(System.in);
System.out.println("It Shorts is Regular? : ");
regular=s.nextBoolean();
}
boolean isCasual()
{
Scanner s=new Scanner(System.in);
System.out.println("It Shorts casual? : ");
casual=s.next();
}
boolean isFancy()
{
Scanner s=new Scanner(System.in);
System.out.println("It Shorts Fancy? : ");
fancy=s.next();
}
}
class Outerwear
{
//code here
}
class SpringCoat extends Outerwear
{
//
}
class WinterJacket extends Outerwear
{
//
}
class Shoes
{
//code here
}
class DressShoes extends Shoes
{
//
}
class RunningShoes extends Shoes
{
//
}
class Steel_ToedBoots extends Shoes
{
//
}
class Accessories
{
//code here
}
class Rings extends Accessories
{
//
}
class EarRings extends Accessories
{
//
}
class Watches extends Accessories
{
//
}
class Ties extends Accessories
{
//
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.