Assessment weight : 20% | Due : Week 9 |
The student information is in the form of a text file markdata.dat. It contains one line of information for each student represented. Each line contains the following information, in the order shown.
Breakdown Of A Student Entry
int
- the student ID numberString
- the name of the studentfloat
- the coursework markfloat
- the exam mark_
")
(since the student name may contain spaces, the space character could not
be used as the delimiter. A sample entry line follows.
Sample Student Entry
50123456_lam tai man_70.50_50.50_
The following is a screen shot of the program after a sample data file has been loaded.
Student ID Name CW mark Exam mark
==================================================
50123456 lam tai man 70.00 60.00
50223456 li tai man 60.00 90.50
50323456 wong tai man 34.50 30.00
50423456 ng tai man 90.50 70.00
50523456 lau tai man 86.00 92.40
50623456 chui tai man 70.00 64.50
50723456 lim tai man 64.50 60.00
50823456 pok tai man 37.50 35.50
50923456 kim tai man 92.40 60.00
50023456 tsang tai man 15.00 20.00
50999999 chan peter 100.00 80.00
Enter one of the following:
1 to read and print the contents of input data file
2 to print all students overall mark
3 to print all students whose mark less than 40
4 to plot distribution of grade
Q to end
Design and implement a python program grade.py that uses the given Student and matplotlib.pyplot classes from Matplotlib and implements the system menu which produces the following outputs:
A grade list in ascending order of student name:
Student ID Name CW mark Exam mark Overall
============================================================
50999999 chan peter 100.00 80.00 88.00
50623456 chui tai man 70.00 64.50 66.70
50923456 kim tai man 92.40 60.00 72.96
50123456 lam tai man 70.00 60.00 64.00
50523456 lau tai man 86.00 92.40 89.84
50223456 li tai man 60.00 90.50 78.30
50723456 lim tai man 64.50 60.00 61.80
50423456 ng tai man 90.50 70.00 78.20
50823456 pok tai man 37.50 35.50 36.30
50023456 tsang tai man 15.00 20.00 18.00
50323456 wong tai man 34.50 30.00 31.80
And for all students whose overall marks less than 40:
Student ID Name CW mark Exam mark Overall
============================================================
50823456 pok tai man 37.50 35.50 36.30
50023456 tsang tai man 15.00 20.00 18.00
50323456 wong tai man 34.50 30.00 31.80
Bar chart of grade distribution:
Scores range | Grade |
---|---|
0 – 39.99 | F |
40 – 49.99 | D |
50 – 64.99 | C |
65 – 74.99 | B |
75 – 100 | A |
50123456_lam tai man_70.0_60.0_
50223456_li tai man_60.0_90.5_
50323456_wong tai man_34.5_30.0_
50423456_ng tai man_90.5_70.0_
50523456_lau tai man_86.0_92.4_
50623456_chui tai man_70.0_64.5_
50723456_lim tai man_64.5_60.0_
50823456_pok tai man_37.5_35.50_
50923456_kim tai man_92.4_60.0_
50023456_tsang tai man_15.0_20.0_
50999999_chan peter_100.00_80.00_
Upon completion, submit only the following.
Activity/Task | Assessment weight | ||||
---|---|---|---|---|---|
Problem Specification and Design:
| 10% | ||||
Python Implementaion
|
The Assignment is to be handed in the prescribed manner: