CS 111: Program 2 main content
Based on Programming Challenge #5: Driver's License Exam Class on page 538 of your textbook.
Write a program to
- read in five multiple choice questions from a file (same as Lab 2)
- display each question, one at a time, to the user
- read the user's answer
- grade the exam and
- display the total number of questions they got right
- display whether they passed the exam (Need at least 60% of the questions right)
- display the question numbers for the questions the user got wrong
Hint: store the user's answers in an array of char.
Sample Session
Design your own console-based user interface. Make it user-friendly and easy to follow
Programming Style Requirements
- Read through the Java Programming Style Guide for expectations.
- Begin every java file with the standard file header
- 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:\Program2\ folder
- The assignment is due at the start of lab 3. 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
- 10 points - User Interface
- Input prompts and output format are easy to follow (3)
- Input Validation: only accept letters A, B, C, and D as answers (3)
- Graded results are clear and easy to understand (4)
- Spelling, capitalization, and grammar are correct (-1 per error)
- Spacing and alignment are correct (-1 per error)
- 25 points - Output Correctness
- The program asks a question and reads the test taker's response (10)
- The program calculates and displays the number of questions answered correctly (5)
- The program calculates and displays whether the test taker passed the exam (5)
- The program stores and displays the question numbers that were answered incorrectly (5)
- 5 points - Object Oriented Design
- The program is subdivided into appropriate classes and methods
- Re-use your MultipleChoiceQuestion class
- Keep methods under 25 lines of code (LOC) in length and do 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
- 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:\Program2\ 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