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.

Objectives

This project will allow you to practice variables, strings, input/output facilities, conditional statements, logical operators, and the Eclipse IDE.

Grading

Clarifications

Any clarifications or corrections associated with this project will be available at Clarifications

Code Distribution

The project's code distribution is available by checking out the project named MoneyIdProg. The code distribution provides you with the following:

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. The name 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. The name must be spelled and capitalized exactly as shown to be considered a valid entry.

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.

Requirements

Sample Runs

The image below illustrates show how your program should behave. Note that items in green 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.
Sample Runs Image

Additional Requirements for Students in Honors Section

There is a special section of this course that is for honor students. If you are registered in cmsc131H then you are expected to complete this part. Otherwise, feel free to ignore it (unless you want extra practice, what we always encourage :)). If you are registered in a non-honor section, you will not receive additional points if you complete this part.

After finishing the implementation of the MoneyIdProg class, make a copy of it and named it MoneyIdProgHonors. Then modify this class so that the program will not terminate after an invalid menu option is provided. Instead the program should keep prompting the user for a 1 or 2. Keep in mind that no tests have been provided in the submit server for this part. We will test this separately and deduce -10 from your total score if you have not implemented this requirement.