HCI chapter 10 Bonus Homework Asssignment
(will
replace the lowest score of your previous ones)
Design, write, test, and compile a
program that does the following things.
- Design
a form that appears as follows (note: input areas are shown as [__];
buttons are shown [like this]; and the report to the left should not
appear until the button [Show summary] is pressed.
|
Student Assignments
Total Points
Student # (1 to 5) [__]
1 2 170 Assignment Score [___]
2 1 90
3 5 475 [Add above score]
4 0 0 [Show summary]
5 2 100
Average
2 83.5 [Exit]
|
- Use at
least one 1x5 (1 element for each student) array to capture the number of
assignments submitted, and another nearly identical one to capture the
assignment score. Don’t bother to capture each assignment, but you are
certainly welcome to do so in a 2-dimensional array if you really want
to. It’s harder than it appears, so
you might want to stick to the basic requirement: simply to accumulate the
number of assignments submitted in the first array and the total points so
far in the second one.
- When
the user clicks the button [Add above score], increase the number of
assignments submitted by that particular student by one, and add the
assignment score to the total points so far. Then clear the boxes for the next entry
of an assignment.
- When
the user clicks the button [Show summary], the report to the left should
be generated in a listview control (see pg.
313).
- After
the last student is shown, an average for the number of assignments (a
simple linear average) should be printed, and an average score for all
assignments (add all of the total points and divide by the total number of
assignments). In this case there are ten assignments and the total number
of points is 835.
- There
should be no data generated by the program; the user should need to
provide all data. Please do not print a report that always shows the data
above! Everything should begin with
zero.
- Upon
pressing [Exit] the program should end.
- Subprograms
or functions are not required.