10-152-311 - Object-Oriented Programming 1

4.3 Gradebook Assignment: Overview

It is time for students to complete their OOP2 Final. Lab 1 and Lab 2 assignments are also available.

In this assignment, you will create methods and call them by referring to the included UML sequence diagrams.

4.3 Gradebook Assignment: Class Diagram

Implement the changes specified in the following UML class diagram.

Create any button(s) and button click event handler(s) in the WPF window designer (if specified in the class diagram).

PNG image of 4.3  Gradebook UML class diagram
  1. When creating classes be sure to:
    1. Ensure the class in the root namespace. This can be done in one of two ways. Either by adding the class in the project, i.e. scenario, or by adding the class to the business classes folder and removing the ".Business_Classes" designation from the namespace.
    2. insert the following line of code immediately above the class definition:
      [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Encapsulation not yet taught.")]
  2. Open the main window (MainWindow.xaml) in designer mode (right-click and click "View Designer" or press Shift-F7 to go to designer mode).

4.3 Gradebook Assignment: Object Diagram

Instantiate the objects and set their field values as specified in the following UML object diagram.

PNG image of 4.3 Gradebook UML object diagram

4.3 Gradebook Assignment: Code Snippet

Within the newGradebookButton click event handler use the following code snippet as your guide to writing the code.

// Create an instance of the Gradebook class.

// Set field values of Blackboard (except for current student).

// Define a temporary course variable.

// Create an instance of the Course class (OOP 1).

// Set field values of the OOP 1 course.

// Add the OOP 1 course to the gradebook.

// Create an instance of the Course class (OOP 2).

// Set field values of the OOP 2 course.

// Define a temporary assignment variable.

// Create an instance of the Assignment class (Lab 1).

// Set field values of Lab 1 (except for AveragePoints and AverageScore).

// Define a temporary attempt variable.

// Create an instance of the Attempt class (Pete).

// Set field values of Pete's attempt.

// Add Pete's attempt to Lab 1's list of attempts.

// Create an instance of the Attempt class (Gwen).

// Set field values of Gwen's attempt.

// Add Gwen's attempt to Lab 1's list of attempts.

// Define and initialize a "total points" accumulator variable.

// Loop through all of Lab 1's attempts, summing their points.

// Set Lab 1's AveragePoints by dividing the total points variable by Lab 1's number of attempts.

// Set Lab 1's AverageScore by dividing its AveragePoints field by its PossiblePoints field.

// Add Lab 1 to the course's list of assignments.

// Create an instance of the assignment class (Lab 2).

// Set field values of Lab 2.

// Add Lab 2 to the course's list of assignments.

// Set field values of the instructor.

// Set field values of the assistant.

// Define a temporary student variable.

// Create an instance of the Student class (Arthur).

// Set field values of Arthur.

// Set field values of Arthur's transcript.

// Define a temporary grade record variable.

// Create an instance of the GradeRecord class (Database Concepts).

// Set field values of the Database Concepts grade record.

// Add the Database Concepts grade record to the transcript's list of grades.

// Create an instance of the GradeRecord class (Web Design 1).

// Set field values of the Web Design 1 grade record.

// Add the Web Design 1 grade record to the transcript's list of grades.

// Create an instance of the GradeRecord class (OOP 1).

// Set field values of the OOP 1 grade record.

// Add the OOP 1 grade record to the transcript's list of grades.

// Set Arthur to be the current student.

// Add Arthur to the OOP 2 roster.

// Create an instance of the Student class (Pete).

// Set field values of Pete.

// Set field values of Pete's transcript.

// Add Pete to the Roster.

// Create an instance of the Student class (Gwen).

// Set field values of Gwen.

// Set field values of Gwen's transcript.

// Add Gwen to the Roster.

// Add the OOP 2 course to the gradebook.

// Set field values of my theme.

// Set field values of the student calendar.

4.3 Gradebook Assignment: Sequence Diagram 1

findOop2Lab1AverageScoreButton

PNG image of the 4.3 Gradebook UML sequence diagram #1

4.3 Gradebook Assignment: Sequence Diagram 2

giveOop2Lab2Button

PNG image of the 4.3 Gradebook UML sequence diagram #2

4.3 Gradebook Assignment: Final Steps

Method details:

  1. See the comments on the various UML diagrams for information required to correctly write the code for this assignment.

Test, Complete and Submit

  1. Build your program - Eliminate compiler errors and warnings
  2. Debug/Test your program - Set breakpoints, step through code, monitor values
  3. Make your code StyleCop-compliant
  4. Close your Visual Studio solution.
  5. Compress your Visual Studio solution to a zip file.
  6. Submit the zip file via Blackboard.

Grading Rubric

PNG image of the 4.3 Gradebook rubric