-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClothesApp.java
58 lines (36 loc) · 978 Bytes
/
ClothesApp.java
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
/*
ClothesApp.java
@ author C Sullivan
7 Feb 2017
*/
import java.util.*;
public class ClothesApp{
public static void main(String args[]){
//variables
int tshirts;
int hoodies;
int caps;
double tshirtsCost;
double hoodiesCost;
double capsCost;
double totalCost;
Scanner keyboard;
keyboard = new Scanner(System.in);
Clothes myClothes;
myClothes=new Clothes();
System.out.println("How many tshirts would you like?");
tshirts=keyboard.nextInt();
myClothes.setTshirts(tshirts);
System.out.println("How many hoodies would you like?");
hoodies=keyboard.nextInt();
myClothes.setHoodies(hoodies);
System.out.println("How many caps would you like?");
caps=keyboard.nextInt();
myClothes.setCaps(caps);
//process
myClothes.compute();
//output
totalCost=myClothes.getTotalCost();
System.out.println("The total cost of your items is "+totalCost);
}
}