A simple text analyzer would display the following statistics:
Starting with the Analyzer project in the Lab7 folder, write a program that allows the user to enter text in a text area. When the user clicks the Analyze button, the program displays, in separate fields (integer, double, text, text respectively) the statistics listed above. You should use a string tokenizer to process the data.
Copy the OneIsZero project folder from your Lab5 folder into your Lab7 folder.
First you should make any corrections to your program as suggested by the graded printouts from Lab 5.
One Is Zero is a simple game played with a single die. When your turn comes, you begin with 0 points for the turn. You roll the die and receive the number of points shown on the die (unless you roll 1). You may then choose to roll again and accumulate points according to the die. Your turn ends when either you choose to quit, keeping the points you have accumulated, or you roll a 1. If you roll a 1, your score for the turn is 0.
You are to write a terminal I/O menu driven program to simulate the playing of the game. For each iteration, the program should display the value of the roll of the die, the number of points accumulated in the current turn, the number of turns that have been played, the total points for all of the turns, and the average number of points per turn. The user should be presented with options to either roll again, to quit this turn, to reset all values back to 0, or to exit the program.
Model versus View: In this program, you are to make a clear distinction between the data model and the view. The data model should have variables for the current roll of the die, the number of points accumulated in the current turn, the total points accumulated for completed turns, the number or turns and the average number of points per turn for the completed turns. There should be absolutely no input from the user except for the responses to the menu options.
Since your main operation will be a loop of displaying results and the menu, and since we know we want to do this once to begin with, you should use a do-while loop for the main loop of the program. Also, since the menu choice of the user provides you with a multi-option situation, you should use a switch statement for handling the various options.
Methods: In this program we are going to emphasize the use of methods that you are to write and employ in your program. Here are some of the methods you should develop and use:
Be sure to include Pre and Post conditions with your methods. If you change any of the methods left over from Lab5, you should note this in the comments and explain why this is necessary.
New operators and features: You should try to make use of as many of the new Java operators, etc. as is reasonable.
Notes:
When you have completed all work on this lab, you should turn in a print out of your final programs to me or the lab assistant. Be sure that you have comments with your information at the top of the programs. Part of the grade will be based on style.
You should also copy your Lab7 folder into your turnin folder.