-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoin.java
More file actions
80 lines (71 loc) · 1.64 KB
/
Coin.java
File metadata and controls
80 lines (71 loc) · 1.64 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* Basic Coin super class.
* @author Lisa Miller
* @since 1/24/22
*/
public class Coin {
//instance variables
/** the Coin value. */
private double value;
/** the name of the Coin type. */
private String name;
/** the image on the front of the Coin. */
private String front;
/** the image on the back. */
private String back;
/**
* Two parameter constructor.
* @param newValue the coin value
* @param newName the coin type name
*/
public Coin(double newValue, String newName, String newFront, String newBack) {
this.value = newValue;
this.name = newName;
this.front = newFront;
this.back = newBack;
}
//get methods
/**
* Gets the value of this Coin.
* @return the value of the Coin.
*/
public double getValue() {
return this.value;
}
/**
* Gets the name of this Coin.
* @return the name of the Coin.
*/
public String getName() {
return this.name;
}
/**
* Gets the color of this Coin.
* Always returns Silver as the default color.
* @return the color of the Coin, Silver.
*/
public String getColor() {
return "Silver";
}
/**
* Gets the description of the front image.
* @return the front of the Coin.
*/
public String getFront() {
return this.front;
}
/**
* Gets the description of the back image.
* @return the back of the Coin.
*/
public String getBack() {
return this.back;
}
/**
* Sets the description of the back image.
* @param the back of the Coin.
*/
public void setBack(String newBack) {
this.back = newBack;
}
}