Skip to content

Commit

Permalink
Seventh Commit - Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
wrainaud committed Oct 7, 2020
1 parent 7bf5839 commit 3640a31
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ public void printList() {
System.out.println(list[newCounter].toString());
}//for
}//printList

public void printEvenElementsList() {
for (int newCounter = 0; newCounter < counter; newCounter++) {
if(newCounter % 2 == 0) {
System.out.println(list[newCounter].toString());
}//if
}//for
}//printList

public void printReverseList() {
for (int newCounter = -1; newCounter > counter; newCounter--) {
System.out.println(list[newCounter].toString());
}//for
}//printList

public static void main(String[] args) {

Expand Down Expand Up @@ -70,8 +84,21 @@ public static void main(String[] args) {
test1.addShowDog("Yellow", "Great Dane");
test1.addShowDog("Brown", "French Bulldog");
test1.addShowDog("Charcoal", "Dobermann");


System.out.println("");
System.out.println("Full List of Animals");
System.out.println("");
test1.printList();

System.out.println("");
System.out.println("Every Even Animal in the Array");
System.out.println("");
test1.printEvenElementsList();

System.out.println("");
System.out.println("Every Animal in the Array in Reverse Order");
System.out.println("");
test1.printReverseList();

}//main

Expand Down

0 comments on commit 3640a31

Please sign in to comment.