CHK122COM Introduction to Algorithms


Assignment

GUI Grade Processing System

Assessment weight : 25% Due : Week 7

Description

Finish a Pyton program that allows the user to load Grade information from a file of grade data. Once the information is loaded, the stock information is displayed in a Text component. The user can then selectively view either 1) all grade data, 2) all students' overall marks, or 3) students whose overall marks less than 40 by clicking the Checkbox components. The class average mark is also displayed in the user interface. To exit the program, the user can click either the 'Quit' Button component or use the program window's system menu.

The following is a screen shot of the program after a sample data file has been loaded.

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

  1. an int - the student ID number
  2. a String - the name of the student
  3. a float - the coursework mark
  4. a float - the exam mark
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_

This assignment consists of two parts: class Student, and the graphical user interface (class GUIgrade). To effeciently complete this assignment, you are encouraged to code and test each module before moving on to the next.

Task 1 The class Student

This is the class that stores information for one student, i.e. information from one line of the markdata.dat information file. Design and implement Student class with the following data members: student id (8 digits), student name, coursework mark (between 0.00 and 100.00), exam mark (between 0.00 and 100.00). Student class has a constructor method with one argument for each data member. There are also appropriate accessors /mutators and service methods. The accessor methods should be named according to the convention getFieldname, where Fieldname is the name, with its first letter capitalized, of the Student field being accessed. For example, the accessor method for the field cousework should be getCousework(). Write one for each of the 4 student fields. One service method should be provided overall() which returns the overall mark from the weighted sum of the coursework mark and the the exam mark. The weights for the coursework and exam should be set at 40% and 60% respectively. Do this by initializing class constants within the Student class. For an example, if the coursework mark is 96, the exam mark is 51, the overall mark will be:

(96 * Student.CWweight) + (51 * Student.EXweight) = 69.00

Where CWweight and EXweight are class constants created.

Finally, implement the method __Str__. It should return a String representation of the Student object. This representation should contain the values of the four fields of the student object, separated (not led or terminated) by a single space. The method __Str__ should not access the instance variables directly. It should make use of accessor methods.

Task 2 Programming for GUI driver class GUIgrade

Design and implement a driver program GUIgrade.py that uses the classes defined and implemented in Task 1 and implements a graphical user interface grade processing system which produces a grade list as shown belows (in ascending order of student name):

When Second button is selected to display overall grade of students.

When third button is selected to display all failure cases.

First write the code that initializes the user interface components.  These components are all members of the Python tkinter library. The following components must be defined:

The program should read data from a text file called markdata.dat and all objects must be stored in a List. Use exception handling to catch errors you find or anticipate.

Test your program with the following test case:

Upon completion, submit only the following.

  1. Student.py
  2. GUIgrade.py
  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.
  • develop an object model of the your system (showing data fields and methods)
15%
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.
  • implementation all methods required in Student class
  • use of all components required in GUIgrade class
  • 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
20%
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: