L07a

Due by the end of scratch end-of -- due BY 3PM, Tuesday, February 27

Starter Files:


SUBMIT   /   Submission Summary

Midterm Review

Activity 1
I have provided you with a program called ListManipulation. If you run it, you will see something like this:
This program reads several words you enter, then prints out the different words in alphabetical order. Short words get ignored. Enter the words below. Enter a period by itself to end input. These are my words . The words are: * These * are * my * words

I want you to complete the normalize method so that it uses a ListIterator to erase any words less than three characters long and change all words to lower case. When complete, you should see something like:

This program reads several words you enter, then prints out the different words in alphabetical order. Short words get ignored. Enter the words below. Enter a period by itself to end input. These are my words . The words are: * are * these * words

NOTE: you don't need to sort the list because the Set will take care of that!

Activity 2
When we created our Bag interface, we decided that we would allow them to contain nulls. Since they could contain nulls, the remove() method could not return null as a special value.

Create a new data type class NoNullsArrayBag that does not allow nulls. Have it extend ArrayBag.

You do not need to create any constructors, but it's fine if you want to recreate the ones ArrayBag has.

Test your program by running TestNoNullsBag. If you've done everything correctly, you should see:

Removed "null". Removed "Two". Removed "One".
If the program SHOUTS AT YOU you've done something wrong.
Your grade will be based on the following rubric:

Submit this/these files:


SUBMIT   /   Submission Summary