diff --git a/TwoLiterStack/.classpath b/TwoLiterStack/.classpath new file mode 100644 index 0000000..fb50116 --- /dev/null +++ b/TwoLiterStack/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/TwoLiterStack/.settings/org.eclipse.jdt.core.prefs b/TwoLiterStack/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2b084d8..0000000 --- a/TwoLiterStack/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,14 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=12 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=12 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=12 diff --git a/TwoLiterStack/src/main/Main.java b/TwoLiterStack/src/main/Main.java index b5e47e3..dd6bd52 100644 --- a/TwoLiterStack/src/main/Main.java +++ b/TwoLiterStack/src/main/Main.java @@ -1,6 +1,10 @@ /* - * Bill Nicholson - * nicholdw@ucmail.uc.edu + * Charlie Hayes + * hayesc9@mail.uc.edu + * Assignment 10 + * IT2045C Spring 2022 + * Due: 4/3/2022 + * This program creates a stack with two liter bottles of soda and prints the total price and amount of dr. pepper in the stack */ package main; @@ -37,5 +41,6 @@ public static void main(String[] args) { if (twoLiter.getFlavor().equals("Dr. Pepper")) {totalDrPepper++;} } System.out.println("Total Dr. Pepper = " + totalDrPepper); + } } diff --git a/TwoLiterStack/src/main/TwoLiter.java b/TwoLiterStack/src/main/TwoLiter.java index 9a6d0d0..b2b7e3b 100644 --- a/TwoLiterStack/src/main/TwoLiter.java +++ b/TwoLiterStack/src/main/TwoLiter.java @@ -1,6 +1,10 @@ /* - * Bill Nicholson - * nicholdw@ucmail.uc.edu + * Charlie Hayes + * hayesc9@mail.uc.edu + * Assignment 10 + * IT2045C Spring 2022 + * Due: 4/3/2022 + * This program creates a stack with two liter bottles of soda and prints the total price and amount of dr. pepper in the stack */ package main; @@ -47,8 +51,8 @@ public static void add(Stack twoLiterStack, int count ) { // Random r = new Random(42); Random r = new Random(); for (int i = 0; i < count; i++) { - twoLiterStack.add(new TwoLiter(UPCs[r.nextInt(UPCs.length - 1)], - flavors[r.nextInt(flavors.length - 1)], + twoLiterStack.add(new TwoLiter(UPCs[r.nextInt(UPCs.length)], //removed the -1 so that the whole string array was being randomized + flavors[r.nextInt(flavors.length)], 1.00 + r.nextFloat())); } }