| |
| META TOPICPARENT |
name="CSC121SylF2023" |
|
|
< < | Methods 2: Inventory control with files: Fall 2023 |
> > | Exceptions: Quiz program using exceptions: Fall 2023 |
| | Learning Objective(s)
- Continue to improve methods
- Continue to work with files
- Become more confident in programming skills
- Simple exception handling
Overview of the Program |
|
< < | Create a program To give multiple choice quizzes to the user. |
> > | Create a program to give multiple choice quizzes to the user. |
| | Specifics
- The program should be called Quizzer
- There should be at least two constants:
|
| |
-
- For each quiz, there are a number of multiple questions with 4 possible answers each.
- For each quiz, the program should inform how many questions were answered and how many were answered correctly.
- The only I/O allowed in the main method should be to get the name of the file containing the next quiz (along with the associated prompt)
|
|
< < |
- You should have one method that will process a an entire quiz. The only I/O it should do is to open and close the file and report on the entire quiz.
|
> > |
- You should have one method that will process an entire quiz. The only I/O it should do is to open and close the file and report on the entire quiz.
|
| |
- You should have a method that asks one question. It asks the question (including giving the possible answers), gets the answer from the user, reports to the user if it is correct and returns that status.
|
|
< < |
- You should have another method that ensures that the user only inputs a, b, c, or d. It should return what it inputs
|
> > |
- You should have another method that ensures that the user only inputs a, b, c, or d. It should return what was inputted correctly.
|
| | Sample dialogue
Below is a sample dialogue. Your output can vary somewhat as long as the required data is nicely displayed |