CHK121COM Introduction to Computing


Assignment

Grade Processing System

Assessment weight : 20% Due : Week 9

Requirements

Write a Python program that allows user to load marks information from a file, calculate overall mark, and display grade information. From the system menu, user can selectively view
1) mark information of data loaded
2) all students’ overall marks
3) students whose overall marks less than 40
4) a bar chart of grade distribution.
To exit the program, user can enter 'Q' in system menu.

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

The items on each line are delimited by the underscore character ("_") (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:

Using grade boundary as follows:

Scores rangeGrade
0 – 39.99F
40 – 49.99D
50 – 64.99C
65 – 74.99B
75 – 100A

Test your program with the following test case:

Files

Download asgn1student.zip and extract the archive that contains the following.

Upon completion, submit only the following.

  1. grade.py
  2. Test data files used
  3. Documentation of your program and testing.

Assessment criteria:

Activity/TaskAssessment weight
Problem Specification and Design:
  • identify input requirements in term of value range, format, restrictions/tolerance to input, using external or internal data, and way to terminate data input.
  • identify output requirements in term of values produced, format, and amount of output.
  • identify special relationship between input and output (for example, how the program handles invalid transaction code), and error handling/recovery procedure.
10%
Python Implementaion
  • you should follow the Style Guide for Python Code in writting your program. Internal program documentation is required and should include the program/module header and usage of descriptive names and comments.
  • produce the output required.
50%
Program correctness
  • test the program with valid case data, boundary case data, special case data, and invalid case data
  • test report of all cases required
35%
User and technical documentation
  • descriptions on commands to invoke the application, details of interactions, explanation of messages produced, and limitations of the application.
5%

Submission

The Assignment is to be handed in the prescribed manner: