diff options
author | msglm <msglm@techchud.xyz> | 2023-01-14 05:31:48 -0600 |
---|---|---|
committer | msglm <msglm@techchud.xyz> | 2023-01-14 05:31:48 -0600 |
commit | 9d53d8857eaa1c9405894a88ca75bc4657e42f35 (patch) | |
tree | eb1efc1d028b949dd83bb710c68be8eff58f26e7 /Java/Cup/CupDemo.java | |
download | school-code-master.tar.gz school-code-master.tar.bz2 school-code-master.zip |
Diffstat (limited to 'Java/Cup/CupDemo.java')
-rw-r--r-- | Java/Cup/CupDemo.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Java/Cup/CupDemo.java b/Java/Cup/CupDemo.java new file mode 100644 index 0000000..9c00d94 --- /dev/null +++ b/Java/Cup/CupDemo.java @@ -0,0 +1,33 @@ +public class CupDemo {
+
+ public static void main (String args []) {
+
+ //cup init
+ Cup FirstCup = new Cup();
+ Cup SecondCup = new Cup(20.0, "Blue", 0.0);
+
+//fill both with 20 oz, this breaks the first cup and will default to the maximum possible capacity
+ FirstCup.fillCup(20);
+ SecondCup.fillCup(20);
+ //print red
+ System.out.println(FirstCup.status());
+ //sip and gulp from blue
+ SecondCup.sip();
+ SecondCup.sip();
+ SecondCup.gulp();
+ //Fill by 6
+ SecondCup.fillCup(6);
+ //print blue
+ System.out.println(SecondCup.status());
+ //empty red
+ FirstCup.emptyCup();
+ //fill red with five
+ FirstCup.fillCup(5);
+ //2x gulp first
+ FirstCup.gulp();
+ FirstCup.gulp();
+ //final print
+ System.out.println(FirstCup.status());
+ }
+}
+
|