UMBC CS 201, Fall 05
UMBC CMSC 201 Fall '05
CSEE | 201 | 201 F'05 | lectures | news | help

CMSC 201
Programming Project Five

Automatic Quiz

Out: Tuesday 11/29/05
UPDATED: Due Before Midnight, Monday 12/12/05

The design document for this project, design5.txt
is due: Before Midnight, Sunday 12/4/05

Engineering Change Notices

The Objective

The objective of this assignment is to give you experience working with linked lists. You'll be using command-line arguments, doing file handling, dynamic memory allocation, passing by reference, and comparing strings. You will also continue to practice using good program design and implementation techniques.

The Background

The Automatic Quiz is a program students can run that will present them with questions about material they have covered recently in class. The questions are presented to the student one at a time and the program waits for the student's response. If the answer is right, the student is informed that s/he is correct. If the response is incorrect, the automatic quiz program shows the student the correct answer. The program then proceeds to display the next question.

The program keeps track of the questions that the student has missed. After the student has finished the quiz, s/he is shown the score, and must repeat the questions that had incorrect responses. After finishing the missed questions, a new (hopefully improved) score is calculated and any questions that were missed again are shown to the student along with their correct answers.

The Task

Design and code a project that uses command-line arguments to get the name of the data file from the user to be used for the quiz and uses linked lists to store the lists of questions.

Sample Run

linux1[71] % a.out colors.dat (Your greeting goes here) Here are your questions. Good luck !!! 1. The primary colors are red, yellow and _________. blue Correct 2. Combining red and yellow pigments produces ______________. orange Correct 3. Combining yellow and blue pigments produces ______________. green Correct 4. Combining blue and red pigments produces ______________. pink Sorry, the correct answer is purple 5. The secondary colors are orange, green and ____________. blue Sorry, the correct answer is purple 6. The complimentary color of red is ______________. green Correct 7. The complimentary color of orange is _____________. blue Correct 8. The complimentary color of purple is _____________. pink Sorry, the correct answer is yellow 9. Combining pigments of any two complimentary colors produces ___________. black Sorry, the correct answer is brown Your score is 55.56% Improve your score by repeating the ones you missed Here are your questions. Good luck !!! 1. Combining blue and red pigments produces ______________. purple Correct 2. The secondary colors are orange, green and ____________. yellow Sorry, the correct answer is purple 3. The complimentary color of purple is _____________. yellow Correct 4. Combining pigments of any two complimentary colors produces ___________. brown Correct Your new score is 88.89% These are the questions and answers you need to study: The secondary colors are orange, green and ____________. purple linux1[72] a.out arith.dat (Your greeting goes here) Here are your questions. Good luck !!! 1. 16 + 5 = 21 Correct 2. 22 + 6 = 28 Correct 3. 49 + 4 = 53 Correct 4. 67 + 8 = 75 Correct 5. 83 + 7 = 90 Correct 6. 72 + 21 = 93 Correct 7. 59 + 33 = 92 Correct 8. 74 + 21 = 95 Correct 9. 48 + 35 = 83 Correct 10. 65 + 13 = 78 Correct 11. 88 + 16 = 94 Sorry, the correct answer is 104 12. 95 + 27 = 112 Sorry, the correct answer is 122 13. 83 + 49 = 132 Correct 14. 76 + 41 = 117 Correct 15. 63 + 58 = 121 Correct 16. 65 - 9 = 54 Sorry, the correct answer is 56 17. 87 - 5 = 82 Correct 18. 73 - 8 = 65 Correct 19. 82 - 6 = 76 Correct 20. 43 - 7 = 34 Sorry, the correct answer is 36 21. 66 - 25 = 41 Correct 22. 85 - 12 = 73 Correct 23. 92 - 28 = 64 Correct 24. 87 - 36 = 51 Correct 25. 53 - 25 = 28 Correct Your score is 84.00% Improve your score by repeating the ones you missed Here are your questions. Good luck !!! 1. 88 + 16 = 104 Correct 2. 95 + 27 = 132 Sorry, the correct answer is 122 3. 65 - 9 = 56 Correct 4. 43 - 7 = 36 Correct Your new score is 96.00% These are the questions and answers you need to study: 95 + 27 = 122 linux1[74] % more colors.dat The primary colors are red, yellow and _________. blue Combining red and yellow pigments produces ______________. orange Combining yellow and blue pigments produces ______________. green Combining blue and red pigments produces ______________. purple The secondary colors are orange, green and ____________. purple The complimentary color of red is ______________. green The complimentary color of orange is _____________. blue The complimentary color of purple is _____________. yellow Combining pigments of any two complimentary colors produces ___________. brown linux1[75] % more arith.dat 16 + 5 = 21 22 + 6 = 28 49 + 4 = 53 67 + 8 = 75 83 + 7 = 90 72 + 21 = 93 59 + 33 = 92 74 + 21 = 95 48 + 35 = 83 65 + 13 = 78 88 + 16 = 104 95 + 27 = 122 83 + 49 = 132 76 + 41 = 117 63 + 58 = 121 65 - 9 = 56 87 - 5 = 82 73 - 8 = 65 82 - 6 = 76 43 - 7 = 36 66 - 25 = 41 85 - 12 = 73 92 - 28 = 64 87 - 36 = 51 53 - 25 = 28

Although your output need not be identical to the above, all information (including the greeting) must be present.

Input Guarantees

Further Specifications

Submitting the Program

Here is a sample submission command. Since you may have different file names you'll have to adjust it to fit your needs. As always, be sure to submit all of the files necessary for your project to compile.
Note that the project name starts with uppercase 'P'.

submit cs201 Proj5 proj5.c list.c list.h quiz.c quiz.h

To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show the file that you submitted in a format similar to the Unix 'ls' command.

submitls cs201 Proj5


CSEE | 201 | 201 F'05 | lectures | news | help

Sunday, 11-Dec-2005 19:24:15 EST