Skip to content

athenian-apcs/arraylist-practice-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArrayList Practice

In this assignment, you'll be writing three methods related to ArrayLists.

The first method is countOdd(). This method takes an ArrayList as input and returns the number of odd numbers in the ArrayList. The method should have the following signature:

public static int countOdd(ArrayList<Integer> list) { }

The next method is checkDuplicates(). This method takes two ArrayList as input and returns true if there is a number that appears in both ArrayLists.

public static boolean checkDuplicates(ArrayList<Integer> list1, ArrayList<Integer> list2) { }

Finally, the last method is convertToArrayList(). Unlike the other methods, this method takes an int[] as input. The method returns an ArrayList containing the values from the int[].

public static ArrayList<Integer> convertToArrayList(int[] arr) { }


Run your code with:

The easiest way to run your code is to press the play button in MyMain.java.

However, you can also run your code by typing the following into the Terminal.

make run

Alternatively, if that doesn't work, use:

./gradlew run

Run your tests with:

The easiest way to run your code is to press the play button in MyTests.java.

However, you can also run your code by typing the following into the Terminal.

make test

Alternatively, if that doesn't work, use:

./gradlew test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published