Added all the classes for counting

master
sgoudham 4 years ago
parent 8b45930137
commit 1010e508ce
No known key found for this signature in database
GPG Key ID: EF51A29A50FB754C

@ -11,7 +11,7 @@ public class CounterMain {
private static void countUp() { private static void countUp() {
ByTwos twos = new ByTwos(); ByTwos twos = new ByTwos();
ByFives fives = new ByFives(); ByFives fives = new ByFives();
// Display the first 5 numbers for each counter defined // Display the first 5 numbers for each counter defined
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
System.out.println("Counting By " + twos.countBy()); System.out.println("Counting By " + twos.countBy());
@ -26,15 +26,15 @@ public class CounterMain {
System.out.println("Enter In The Number That You Want To Count:\n"); System.out.println("Enter In The Number That You Want To Count:\n");
int userInput = in.nextInt(); int userInput = in.nextInt();
CounterHelper helper = new CounterHelper(new ByTwos(), new ByThrees(), new ByFives()); CounterHelper helper = new CounterHelper(new ByOnes(), new ByTwos(), new ByThrees(), new ByFours(),
new ByFives());
helper.doInteractive(userInput); helper.doInteractive(userInput);
System.out.println("Enter In The Number Of Times You Want To Count:\n"); System.out.println("Enter In The Number Of Times You Want To Count:\n");
int userIterations = in.nextInt(); int userIterations = in.nextInt();
helper.displayCounter(userIterations); helper.displayCounter(userIterations);
in.close(); in.close();
} }
} }

Loading…
Cancel
Save