Course web page: Introduction to Computer Science for majors II James Tam Return to the course web page

CPSC 233: Full Assignment 2

Due Friday October 9 at 4 PM

New concepts to be applied for this assignment

Description

Implement a simple grade management program. Grades are stored as numeric grade points (4.0, 3.7, 3.3...0.0). The program includes basic statistical generation (average) and visualization of the data (show highest, lowest grade) as well as the ability to initialize grades (hard-coded or random). The program will employ a text-based menu-driven interface. There is not a requirement for including user input of the grades but the program should include the ability to either randomly assign grades or set the first ten elements to a fixed value (both of which will be useful when testing the other features).

Technical details

The program consists of 3 classes:

Program features

Your marks will also be determined by your adherence to the stylistic conventions taught in class as well your program documentation. Also all output should not only be correct and the results clear but also reasonably neat and presentable. The real number portion of a grade should only be displayed to one place of precision (e.g. 3.0 and not 3.00)

  • Correct and appropriate definitions of the three required classes (need not be functional to get some credit, methods can be 'skeletons')
  • List of grades has each element initialized to starting value outside the range of valid values (e.g., -1)
  • A main menu of program options is displayed: average grade, display grades, find highest, find lowest, random and fixed initialization of list, quit program.
  • Get user selection (of the options at the main menu)
  • Program runs until the user selects the option to quit the program (display menu, get user input, execute user select option, repeat until the user quits)
  • Display the contents of the list (you only get credit for one version)
    
  • Basic version: displays all the grades in the list
    
  • Advanced version: only displays list elements that contains a valid grade i.e., if the list only contains 10 grades then only the first 10 elements will be displayed. The ability to only display occupied elements should be determined at run-time and not set to a hard-coded number of list elements.
  • Assign grades to each list element randomly. To make it simple randomly assigned grades can consist only of integer values ranging from zero to four.
  • Assign a grade of 2.0 to the first ten elements.
  • Calculate and display the average grade.
  • Determine and display the highest grade in the list
  • Determine and display the lowest grade in the list

UML class diagram

You should create a UML diagram for class "Manager" and class "UserInteraface". All information for a class should be specified (e.g., attributes, methods, parameters, return values, permission levels). Also the relationship between the two classes including multiplicity (see the notes which introduce Object-Oriented concepts) should be specified. The class diagram can be drawn using any structured drawing program (even PowerPoint). However it must be correct and it must be understandable by the marker. The image that you submit via D2L must be in one of the following formats: 'gif', 'jpg', 'png' or 'pdf''.

Using pre-written Java code

You will need to use the built in code class Random. Beyond that (and common sense operators and functions such as those for input/output and mathematical operators), unless you told otherwise, you will need to write your own code and cannot use other pre-written Java classes or operators.

Sample execution

You can see sample output files in the A2 directory (/home/233/assignments/assignment2/output).

Submitting your work:

  1. Assignments (source code/'dot-java' files) must be electronically submitted according to [the assignment submission requirements] using [D2L].
  2. As a reminder, you are not allowed to work in groups for this class. Copying the work of another student will be regarded as academic misconduct (cheating).  For additional details about what is and is not okay for this class please refer to the following [link].
  3. Before you submit your assignment to help make sure that you haven't missed anything here is a [checklist] of items to be used in marking.