-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoinDriver.java
More file actions
57 lines (43 loc) · 2.01 KB
/
CoinDriver.java
File metadata and controls
57 lines (43 loc) · 2.01 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
/**
* Driver class for Basic Coins.
* @author Lisa Miller
* @since 1/24/22
*/
public class CoinDriver {
/** main method.
* @param args not used
*/
public static void main(String[] args) {
//test all the constructors
DollarCoin c1 = new DollarCoin();
HalfDollar c2 = new HalfDollar();
Quarter c3 = new Quarter();
Dime c4 = new Dime();
Nickel c5 = new Nickel();
Penny c6 = new Penny();
//State Quarters
Quarter s1 = new Quarter("Hawaii");
Quarter s2 = new Quarter("California");
System.out.print("The first coin is a " + c1.getName());
System.out.print(", it is " + c1.getColor() + " colored,");
System.out.println(" it is worth $ " + c1.getValue());
System.out.print("The second coin is a " + c2.getName());
System.out.print(", it is " + c2.getColor() + " colored,");
System.out.println(" it is worth $ " + c2.getValue());
System.out.print("The third coin is a " + c3.getName());
System.out.print(", it is " + c3.getColor() + " colored,");
System.out.println(" it is worth $ " + c3.getValue());
System.out.print("The fourth coin is a " + c4.getName());
System.out.print(", it is " + c4.getColor() + " colored,");
System.out.println(" it is worth $ " + c4.getValue());
System.out.print("The fifth coin is a " + c5.getName());
System.out.print(", it is " + c5.getColor() + " colored,");
System.out.println(" it is worth $ " + c5.getValue());
System.out.print("The sixth coin is a " + c6.getName());
System.out.print(", it is " + c6.getColor() + " colored,");
System.out.println(" it is worth $ " + c6.getValue());
System.out.println("\n\nThe back of a regular Quarter is: " + c3.getBack());
System.out.println("The back of a Hawaii Quarter is: " + s1.getBack());
System.out.println("The back of a California Quarter is: " + s2.getBack());
} //close main
} //close class