Assignment 3: Teacher's Helper
We have the following goal: we want to design a program that can assist a teacher with finding averages and computing scores for exams. The program should contain a menu, where the user can choose among 3 different options, as well as an additional option to quit the program.
For example, the menu might look similar to the following:
Teacher's Helper - Finding Averages -----------------------------------  Compute Averages  Compute weighted Averages  Total exam scores  Exit program
Specifically, the three choices should accomplish the following:
When this choice is picked, the computer should compute the average of any amount of numbers. You could accomplish this in two ways:
While I would prefer the second approach, you are free to design your program according to either method.
This time, you should ask the user first as to how many number to average. Then, you should ask for a pair of numbers. The first one is a weight (number between 0 and 1) of the score, and the second one is the score itself. When the user has entered the appropriate amount of numbers, the computer should compute the weighted average and display the answer.
For example, I might have 3 scores, one for the exams, one for the homeworks, and one for the quizzes for all students. The scores, in order, are 89, 75, and 66. I want to give the exams 50% weight, and either of the other two should get 25% each.
The formula to compute the weighted average would be:
wAverage = weight1 * score1 + weight2 * score2 + weight3 * score3
|weight1 = 0.5 and score1 = 89|
|weight2 = 0.25 and score2 = 75|
|weight3 = 0.25 and score3 = 66|
For extra credit, your program could display a warning message if the weights do not add up to one. Or, again for extra credit, do this part of the program so that the number for the weight *must* be between 0 and 1 always....
This time, I want the program to accomplish the following: my exams are usually copied on 3 or 4 pages. I write down the total amount of points for one page at the bottom corner of each page. I want this program to first ask me how many exams are to be added, and then how many pages each exam has. Then, for each exam, the computer should ask for a number. After entering one number per page, the computer should display the total sum for that exam, then move on to the next exam. When all exams have been entered and totaled, the computer should also give me the average of all exam scores.
For example, if I had 10 exams, each with three pages, the computer should ask questions like:
|Enter number of exams: 10|
|Enter number of pages: 3|
|Enter exam 1 information: |
|Total for this exam: 80|
|Enter exam 2 information: |
|Total for this exam: 66|
And so forth, until all information for the 10 exams has been added. After that, the computer should compute and display the average for all exams.
As discussed in class, you could - as a suggestion - create the following functions to get the menu system to work properly:
Remember, we have already desgined - more or less - the strategy for making the menus work. What remains to do is to create these three functions (or subtasks) doChoice1, doChoice2, and doChoice3. Keep in mind that these functions, if necessary, can again call on other functions that you may have defined earlier.
If you have any question, please contact me right ayay. Thanks, good luck, and have fun ...