forked from rick2785/JavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGallons.java
More file actions
24 lines (17 loc) · 466 Bytes
/
Gallons.java
File metadata and controls
24 lines (17 loc) · 466 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class Gallons extends Expression{
public String gallons(double quantity) {
return Double.toString(quantity);
}
public String quarts(double quantity) {
return Double.toString(quantity*4);
}
public String pints(double quantity) {
return Double.toString(quantity*8);
}
public String cups(double quantity) {
return Double.toString(quantity*16);
}
public String tablespoons(double quantity) {
return Double.toString(quantity*256);
}
}