-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathP117num12.java
63 lines (44 loc) · 1.21 KB
/
P117num12.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
59
60
61
62
63
public class P117num12
{
public static void main (String[] args)
throws InterruptedException {
String importantInfo[] = {
"working.",
"working..",
"working...",
"~complete~"
};
double qat = 0.0;
double dim = 0.0;
double nik = 0.0;
double pen = 0.0;
double qat_sum = 0.0;
double dim_sum = 0.0;
double nik_sum = 0.0;
double pen_sum = 0.0;
double total = 0.0;
System.out.println ("How many quarters?");
qat = SavitchIn.readDouble();
System.out.println ("How many dimes?");
dim = SavitchIn.readDouble();
System.out.println ("How many nickels?");
nik = SavitchIn.readDouble();
System.out.println ("How many pennies?");
pen = SavitchIn.readDouble();
qat_sum = qat*.25;
dim_sum = dim*.10;
nik_sum = nik*.05;
pen_sum = pen*.01;
total = qat_sum+dim_sum+nik_sum+pen_sum;
for (int i = 0;
i < importantInfo.length;
i++) {
//Pause for 4 seconds
Thread.sleep(4000);
//Print a message
System.out.println(importantInfo[i]);
}
System.out.println ("Jar contains: $"+total);
}
}
}