Assignment #4 Instructions

  1. 10.1 Exercise 3:
    • Write a method called removeEvenLength that takes an ArrayList of strings as a parameter and removes all of the strings of even length from the list.
    • Given the list ["1", "12", "123", "1234"] your method will modify the list leaving ["1", "123"].
    • NOTE: this is not a method being added to your ArrayIntList class ... it is a static method that works on an ArrayList.
    • Name your new class <your name>_Assign4a.java.
    • Your program must EXACTLY match the designated output found in Assign4aOutput.txt.
    • Use the provided Assign4aTester.java main program tester to verify your method is correct. Add your removeEvenLength() method to this tester program.
  2. 11.2 Exercise 6:
    • Write a method countUnique that accepts a list of integers as a parameter and returns the number of unique integer values in the list. Use a set as auxiliary storage to help you solve this problem. For example, if a list contains the values [3, 7, 3, -1, 2, 3, 7, 2, 15, 15] your method should return 5. The empty list contains 0 unique elements.
    • NOTE: this is not a method being added to your ArrayIntList class ... it is a static method that works on an List.
    • Name your new class <your name>_Assign4b.java.
    • Your program must EXACTLY match the designated output found in Assign4bOutput.txt.
    • Use the provided Assign4bTester.java main program tester to verify your method is correct.

Use the .

output comparision tool!

Submit the assignment 4 source code file to me as usual via DropItToMe

Follow class programming standards and formatting/indentation rules. Make sure you comment your code! In your method headers you must include pre and postconditions.

Assignment Grading

The assignment is worth 35 points.

This is pretty simple...you get 100% if your output exactly matches the expected output...and...0% if it has ANY differences.

Make sure you get all the spelling, capitalization, punctuation, spacing, etc. correct! Hint: copy-n-paste is a wonderful thing! :)