CS 2102 - D-term 14

Homework 3 - Designing with Interfaces and Abstract Classes

Due: Thursday, March 27 at the beginning of class (12pm)


This assignment is to be done individually. The assignment is due at the beginning of class (12pm) on Thursday, March 27. We'll be going over a solution to the assignment in class on Thursday, so late assignments will not be accepted. NO EXCEPTIONS.

Assignment Goals


Problem Statement

The first version of the tournament program contained definitions for BaseballScore and SoccerScore. In the next homework assignment (HW4), you will be adding a new kind of score, SwimmingScore, to go along with a new sport, swimming. The components of a SwimmingScore are the times of the two contestants.

Different tournaments have different notions of contestants: baseball and soccer are team sports, while swimming is an individual sport. Soccer and swimming both track rankings (so top-ranked competitors won't face each other in an early tournament round). This week, we extend our model of tournaments to capture both team sports and ranked sports.

Previously, MatchData consisted of the names (Strings) of the two contestants, and the score of the match. You will be modifying MatchData so that instead of using a String to represent a contestant, you'll use a new type IContestant. You'll be implementing separate contestants for soccer, baseball, and swimming, subject to the following constraints:

Your task for Homework 3 is to design the part of the class hierarchy rooted at IContestant. Your hierarchy should be represented as a class diagram, as was done in Homework 1. Each box in the class diagram will specify only the name of the class/abstract class/interface and the fields, if any (the part of the box reserved for methods will be empty). Submit only the portion of the hierarchy rooted at IContestant (do not show the class diagrams for ITournament, InitMatch, AdvanceMatch, SwimmingScore, etc.).

Grading

You will be graded on

What to Turn In

Your solution should be submitted on paper (either handwritten or computer generated). If your assignment is handwritten, make sure it's legible; illegible work will not be graded. The first page of your solution should contain only your name, WPI username, and section number (the reverse side of the first page should be blank). The following page(s) should contain your class hierarchy. All pages must be stapled together. We're asking you to follow these rules so that we can get your assignments graded and returned to you as quickly as possible.