Comp 101 Lab 5 - Text fun

Due: Monday Nov 24th at 11:59pm.

Summary:
In this lab you will create a program which will provide users 3 text based amusements. This is a longer assignment with more code than any of the programs previously assigned, so you should start early. The assignments are chunked into smaller sub projects so it should not be overwhelming.


Details:

In this lab you will build a reasonably large program completely on your own. There are no starter files for this one.

Before you begin, create a folder called Lab5

mkdir Lab5

and do all of your work in that folder.

You will have three different toy activities in this lab. Each of the activities will be a text based amusement. Each one must also be implemented in its own class. (so you will have three - or perhaps four classes). Each of the three programs is detailed in its own section below.

The main method.


The main method should have a loop in it. The loop should do the following things
  1.    prompt the user to either choose one of the three toy programs that you've implemented or  quit the program.
  2. if the user chose to quit then quit (possibly by using System.exit()
  3. Otherwise create an object of the class the user chose and call any methods on it that you need to call.
  4. repeat the process.(go back to step 1)

The first class:

The first toy will sing that old childhood staple "the ants go marching". This toy will do the following:
  1. Ask the user how many verses he/she wants to see. 
  2. in a loop print out the current verse. Programatically generate the lyrics that change each time through the loop. 
    1. I need to be able to choose any number of versese up to 256 verses and your program should still work.
  3. after the program has printed out all of the verses, this toys run should end.
for those of you who do not remember the ants go marching - here is a sample of the first two verses notice that I've simplified it. The original had one line that differed for each verse. Now every verse is identical except for the number of the verse which changes each time. Your program should do the same.:

The ants go marching 1 by 1, hurrah, hurrah
The ants go marching 1 by 1, hurrah, hurrah
The ants go marching 1 by 1,
The little one stops to <fill in here>
And they all go marching down to the ground
To get out of the rain, BOOM! BOOM! BOOM!

The ants go marching 2 by 2, hurrah, hurrah
The ants go marching 2 by 2, hurrah, hurrah
The ants go marching 2 by 2,
The little one stops to <fill in here>
And they all go marching down to the ground
To get out of the rain, BOOM! BOOM! BOOM!

Your class for this problem needs to have at least the following features:
Hint: this one is screaming for a for loop. (the definite loop)

The second class:


In this class you will prompt the user to enter a series of  words. You're program will count the number of characters in each word, and produce statistics on the the words passed in. You need to let the user enter as many words as he/she wishes to. Design a sentinal value that will indicate the end of the input. Remember to mention to your users what the sentinal value is.

I suggest you use the DataSet.java and DataAnalyzer.java classes as your templates for this one. The application is different enough that you will have to think about what you are doing, but close enough to use the structure in those two classes.

the Third class:

This class will be a simulated dice game. It will be played with two standard six-sided dice. It should have the following functionality:

This class must have the following structure - any additional instance variables or methods are up to you:
Extra credit: 5 points extra credit for error checking to make sure that the user only enters target values from one to six in this third class.

Extra credit part 2: 5 more points of extra credit available if you keep track of how many "dice rolls" it takes to finally get the two target numbers.


Submitting

Remember to comment your code!

When you submit this time, add a readme.txt file to your Lab5 folder that you are building. This time you are buiding an insteresting program which may be different from everyone elses so the readme should contain:
Once you have the readme done, cd into your parent folder, zip up the entire lab4 folder using the -r flag as you have learned in the last few labs, and use the online submission program to submit it to me. Remember to include your last name in the title of your zip file.