Team Gradebook

You will do part of this exercise by yourself. You MAY do some of this exercise with a partner.

This exercise will let you practice creating new objects and adding member variables and methods to classes.

What to do

  1. Import the TeamGradeBook project from your individual git repository by following these instructions.
  2. Enter your solutions in the TeamGradeBook project
  3. Run the included unit tests to ensure you solution works
  4. Submit your code by committing and pushing your solution to your individual git repository. Instructions for doing so are provided at this location.

Rubric

Total possible: 70 points.

The Individual Part (do by yourself)

In this program, we’re writing a grading application for a hypothetical school class. In this class, each student is a member of one or more named teams. The teams are given grades for the work they submit. A student’s average is the average of all the grades given to each of the teams of which that student is a member.

The system will also track the number of absences each student has.

The interface for this program is entirely text based. This will give you an idea of how the program should work. The green text is what the user inputs, the black text is the output of the program:

Welcome to Team gradebook.  Enter commands.  Type 'exit' to end.
add-student Steve
ok
add-student Anne
ok
add-student Carlo
ok
add-team TeamSA Steve Anne
ok
add-team TeamAC Anne Carlo
ok
add-grade TeamSA 90
ok
add-grade TeamAC 80
ok
get-average Steve
90
get-average Carlo
80
get-average Anne
85
exit

The good news is that the difficulty of dealing with the text based input and output of the program has all been done for you. All you’ll have to write is the code to update the program’s grade information.

To solve this problem, you’ll use 3 classes. The instances of the Student class will keep each student’s name and grades. The instances of the Team class will keep track of each team’s name and the students in that team. The TeamGradebook class will store a list of all the students and a list of all the Teams.

To make things work, you’ll need to write code for the following commands:

Some additional details and hints are provided in the comments of the methods themselves.

Unit tests for these methods have been provided, although there’s a limited amount that can be tested until get-average works.

The Paired Part (do with a partner if you want)

For this part, you can work with a single partner. Both you and your partner should make clear who you worked with in the comments so there’s no issue of cheating. Also, although you can work together and help each other – your code for the individual part should not be identical. As a result, you may have to write slightly different code for the Paired Part.

If you want you can also work alone for this part.

Here’s what you should do:

Example:


Welcome to Team gradebook.  Enter commands.  Type 'exit' to end.
add-team Team1 Amy Bob
ok
add-team Team2 Bob Cindy
ok
add-grade Team1 80
ok
add-grade Team2 90
ok
get-average Cindy
90
get-best-team
Team2