forked from rick2785/JavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCups.java
More file actions
24 lines (17 loc) · 462 Bytes
/
Cups.java
File metadata and controls
24 lines (17 loc) · 462 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 Cups extends Expression{
public String gallons(double quantity) {
return Double.toString(quantity/16);
}
public String quarts(double quantity) {
return Double.toString(quantity/4);
}
public String pints(double quantity) {
return Double.toString(quantity/2);
}
public String cups(double quantity) {
return Double.toString(quantity);
}
public String tablespoons(double quantity) {
return Double.toString(quantity*16);
}
}