-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDresserFrontEnd.java
More file actions
60 lines (56 loc) · 1.47 KB
/
DresserFrontEnd.java
File metadata and controls
60 lines (56 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Jiarong Xu
*/
import java.util.Scanner;
public class DresserFrontEnd {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
//welcome + Create dresser
Dresser d = new Dresser();
System.out.println("Welcome to the dresser!\n");
boolean quit = false;
// start
while(!quit)
{
System.out.println("Enter 1: to add an item\n"
+ "Enter 2: to remove an item\n"
+ "Enter 3: to print out the dresser contents\n"
+ "Enter 9: to quit");
int i = keyboard.nextInt();
//keyboard.next();
if(i==1)
{
System.out.println("Enter the type\n"
+ "It may be undergarment, socks, stockings, top, bottom, or cape");
String s1 = keyboard.next();
System.out.println("Enter a color\n"
+ "It may be brown, pink, orange, green, blue, purple, or grey");
String s2 = keyboard.next();
d.addClothing(new Clothing(s1,s2));
//System.out.println("1");
}
else if(i==2)
{
System.out.println("Enter the type\n"
+ "It may be undergarment, socks, stockings, top, bottom, or cape");
String s1 = keyboard.next();
System.out.println("Enter a color\n"
+ "It may be brown, pink, orange, green, blue, purple, or grey");
String s2 = keyboard.next();
d.removeClothing(new Clothing(s1,s2));
}
else if(i==3)
{
d.sortDresser();
d.print();
}
else if(i==9)
{
quit = true;
System.out.println("Goodbye!");
}
else
System.out.println("Invalid value! Please input again!");
}
}
}