CS 1401 Assignment #4

Date Assigned: Monday, February 13, 2006 or Tuesday, February 14, 2006.

Due Date: correspondingly, Monday, February 20, 2006, or Tuesday, February 21, 2006, before the beginning of your lab section.

Goals: to learn to design objects and value-returning methods.

Points: This assignment is worth a total of 20 points. No late assignments will be accepted, but credit will be given for partially completed assignments turned in on time.

Assignment: In this assignment, we will deal with the same competition assignment as in Assignment 3, with the following difference:

Reminder: To encourage the departments to work better, the university is thinking of organizing a competition between different departments, so that students from a winning department will get a special celebration party.

There are many possible criteria for selecting a winning department: the number of students n, their average GPA g, the percentage h of students who are members of honor societies, the percentage a of students who are active in professional organizations (like ACM), and the number p of research publications co-authored by senior and graduate students, etc. To select a winning department, we combine these criteria, with certain weights, into a single rating

r = wn * n + wg * g + wh * h + wa * a + wp * p.
Assume that wn = 1, wg = 50, wh = 1, wa = 2, and wp = 40. Keep all the weights as named constants, to make it easier to change them later on.

To help the university, we must design a template that would compute such a rating for different departments.

Desired structure: define three classes:

Class Student should contain:

Class Design should contain:

Named constants related to weights should be defined in the class Department.

The application class should do the following:

Deliverables: as announced in the labs.

Homework part. On a separate sheet of paper, please do Exercise 9 (p. 145), and Ex. 5 Ex. 3 (p. 147). Explain your answers. Return the sheet with your answers to your TA by, correspondingly, Monday February 20 or Thursday February 21 before the beginning of your lab session.