|
Project #1 |
CMSC 131 |
|
Due: Wednesday 9/23 at 11:00 pm |
Object-Oriented Programming I |
|
Type of project: Open |
Fall 2007 |
On The Money



Objective
This project will allow you to practice variables, strings, input/output facilities, conditional statements, logical operators, and the Eclipse IDE.
Overview
You will write a very simple application that asks the user to identify which person appears on which denomination of U.S. currency (or vice versa). It's not the most exciting project, but we have to start somewhere!
This project is considered "open". Please visit the course web page for information regarding the open/closed policy for projects of this course.
Specifications
Your program knows three things: Washington appears on the $1 bill, Hamilton appears on the $10 bill, and Franklin appears on the $100 bill. That's it.
The program begins by prompting the user with:
Type 1 to enter a denomination, 2 to enter a last name:
The user will enter an integer in reply to your inquiry. The user should enter either 1 or 2.
If neither a 1 nor a 2 is entered by the user, the program should terminate after displaying the message "Invalid Menu Option".
Processing an Entry of "1"
The program prompts the user with:
Choose a denomination:
The user will type an integer as a reply to this prompt. The user should enter either "1", "10", or "100". If any other number is entered, the program will print out "Invalid choice!" and will terminate with no further output. You may assume at this point that the user will enter a number (not a string).
Assuming that the user has entered one of the three valid denominations, the program prompts the user with:
Which person appears on the n dollar bill?
[In the prompt above, the "n" must actually be either 1, 10, or 100, depending on what the user has selected.]
The user will enter a String in reply to this prompt. If the name entered represents the correct person for this denomination, the program will output "Correct!" and terminate. But if the user has entered the wrong name, then the program will output "Incorrect!" and terminate. It must be spelled correctly and have only the first character capitalized to be correct.
Processing an Entry of "2"
The program prompts the user with:
Choose a name:
The user will type some string of characters at this point. The user should enter either "Washington", "Hamilton", or "Franklin". If any other String is entered, the program will print out "Invalid choice!" and will terminate with no further output. It must be spelled and capitalized exactly as shown to be considered the same name.
Assuming that the user has entered one of the three valid names, the program prompts the user with:
Which denomination does name appear on?
[In the prompt above, "name" must actually be either Washington, Hamilton, or Franklin, depending on what the user typed as the previous response.]
The user will enter an integer in reply to this prompt. If the value entered represents the correct denomination for the name given, the program will output "Correct!" and terminate. But if the user has entered the value that is not the denomination corresponding to the name typed previously, then the program will output "Incorrect!" and terminate.
Getting Started
In order to help you get started, we have defined an OnTheMoney class with a main( ) method in a file named OnTheMoney.java. This file can be retrieved by checking out the project called Fall09Proj1 from the CVS repository. Remember that you must have set up your repository in order to check out and submit projects. (Refer to Project #0 for more specific instructions.) After checking out the project, switch over to Java perspective to open the source-code file and begin working on it.
If you write the project from scratch, without checking out the "Fall09Proj1" files from your CVS repository, you will not be able to submit your work.
Requirements
The following examples show how your program should behave. Note that items in italics represent the things that are entered by the user. Keep in mind these are just examples and not the only scenarios that your program is expected to handle.
Example 1:
Type 1 to enter a denomination, 2 to enter a last name: 8
Invalid Menu Option
Example 2:
Type 1 to enter a denomination, 2 to enter a last name: 1
Choose a denomination: 5
Invalid choice!
Example 3:
Type 1 to enter a denomination, 2 to enter a last name: 2
Choose a name: Plane
Invalid choice!
Example 4:
Type 1 to enter a denomination, 2 to enter a last name: 1
Choose a denomination: 100
Which person appears on the 100 dollar bill? Franklin
Correct!
Example 5:
Type 1 to enter a denomination, 2 to enter a last name: 1
Choose a denomination: 100
Which person appears on the 100 dollar bill? Plane
Incorrect!
Example 6:
Type 1 to enter a denomination, 2 to enter a last name: 2
Choose a name: Franklin
Which denomination does Franklin appear on? 1
Incorrect!
Example 7:
Type 1 to enter a denomination, 2 to enter a last name: 2
Choose a name: Hamilton
Which denomination does Hamilton appear on? 10
Correct!
Submission
Submit your project from Eclipse by right-clicking the project folder and selecting "submit". You may submit as many times as you want -- we only grade your most recent submission. After you have submitted your project, you should visit the submit server. There you can obtain limited feedback about how well your project is performing. The number of times you can run our tests on your project (before the due date) is limited. The earlier you begin working on the project, the more opportunities you will have to see how your project performs on our tests before the due date!
Grading
There are seven release tests which will be run on your project. Together, these tests will dictate 90% of the grade on the project. The remaining 10% will be based on your use of correct programming style.