CS 111: Program 3 main content
Based on Programming Challenge #7: Check Writer Class on page 603 of your textbook.
Write a program that displays a simulated paycheck.
- The program should ask the user to enter the date, the payee's name, and the amount of the check.
- It should then display a simulated check with the dollar amount spelled out
- Note: Write a
NumberConverter class with static class methods to convert the check amount to the spelled out string.
Sample Session
Enter the check date: 4/16/2006
Enter the name of the payee: Ed Gellenbeck
Enter the amount of the check: 1225.33
Date: 4/16/2006
Pay to the order of: Ed Gellenbeck $1,225.33
One thousand two hundred twenty-five and 33 cents
Programming Style Requirements
- Read through the Java Programming Style Guide for expectations.
- Begin every java file with the standard file header
- Begin every method with a brief comment describing the purpose of the method
- Use jGRASP's Control Structure Diagram (CSD) for indentation.
- Print your source code with CSD and line numbers.
What to turn in
- Source program printouts stapled together with file header comments on all printouts
- Be sure your project is saved in your
u:\Program3\ folder
- The assignment is due at the start of lab 4. You program must compile and produce output for you to receive any credit.
- You are allowed one late programming assignment for the quarter.
Grading Criteria
50 points maximum
- 5 points - User Interface
- Input prompts and output format are easy to follow (1)
- Input Validation: only accept pay check amounts greater or equal to $1.00 and less than $10,000 dollars (3)
- Simulated check format clear and easy to follow (1)
- Spelling, capitalization, and grammar are correct (-1 per error)
- Spacing and alignment are correct (-1 per error)
- 30 points - Output Correctness
- The simulated check's date, payee, and numeric amounts are correct (5)
- The spelled out dollar amounts are correct for thousand dollar checks (e.g. $1920.85) (5)
- One thousand nine hundred twenty and 85 cents
- The spelled out dollar amounts are correct for hundred dollar checks (e.g. $550.00) (5)
- Five hundred fifty and no cents
- The spelled out dollar amounts are correct for tens-ones check amounts (e.g. $45.01) (5)
- The spelled out dollar amounts are correct for teens check amounts (e.g. $19.07) (5)
- The spelled out dollar amounts begin with a capital letter (5)
- 5 points - Object Oriented Design
- The program is subdivided into appropriate classes and methods
- Write a
NumberConverter class with static class methods
- Keep methods under 25 lines of code (LOC) in length and do only one thing per method
- Use private helper methods whenever appropriate
- 5 points - Programming Style
- Program header comments are present and complete. All files need header comments (2)
- Single-line comments are present, helpful, and sufficient (2)
- Skip a blank line before every single-line comment
- Align the comment with the code
- Generally one single-line comment is needed for every four to six lines of code
- Begin every method with a single-line comment describing what the method does
- Naming conventions, alignment, and indentation are important. Read through the Java Style Guide for CS 111 expectations (1)
- 5 points - Creation and printout of the jGRASP Project files
- Project
U:\Program3\ created correctly in your network cs111 account and project files saved correctly in the project folder (2)
- Source printouts submitted correctly
- Avoid line wrap in your source printout
- Print both files with line numbers and CSD showing