CS 2620 Assignment #5 Summer 2004

How to handin.
Points : 30
Weight : 3%
Due : Monday May 31, 2004 @ 11:00 PM
Note : Late assignments will be accepted only with the instructor's pre-approval.


Marks will be awarded for comments, style, readability, compiling and working correctly.
  1. [10] Specialization
    You did such a good job writing the point class that a very important company has requested that you do some follow up work for them. They require that all their points have labels!! A label is just a string that is the name of the point so that points can be referred to by name. They like the distance function that you wrote but need to be able to perform other functions with points. You agree to take on this new assignment.

    You are to create a namedPoint class to satisfy the requirements. DO NOT start from scratch, rather inherit from the point class that you wrote in assignment 4 and then add the new features.

    A namedPoint is a point with the following additional features:

  2. [20] Virtual and Pure Virtual functions
    There are many different types of employees. All employees have With each employee you can Of course there may be other attributes and behaviours needed.

    There are many types of employees, some of which include :

    1. salaried -- which have deductions including taxes, CPP and EI
    2. hourly salaried -- whose pay rate represents the hourly pay. They also have the number of hours worked and have to pay union dues. They get paid time and a half for any hours worked in excess of 40 hours per week.
    3. annual salaried -- whose pay rate is their annual salary.
    4. contract -- which have a number of units completed
    5. piece work contract -- whose pay rate is the price paid per unit.
    6. commission contract -- whose pay rate is the % commission and whose number of units worked is the total sales in dollars. They also have a bonus number which represents the sales amount after which they qualify for a bonus commission. Any amount of sales greater than this limit, earns them an extra 1% bonus.
    7. volunteers -- whose payrate is typically $0 but may be a small honourarium. They have number of hours served.

    You may use the following in your calculations :

    Define and implement a class hierarchy to manage the described employees. Decide which functions should be virtual and which should be pure virtual.

    Write a client program to test your classes. This program should create an employee of each type. After each employee is created, your program should call a function which records work for the employee. It then calls a function to calculate the gross and net pay for the employee and another to print the information for the employee. The parameters to these function should be a reference to a base class object so that run time polymorphism is used.


Assignment List | Prev | Next | Computer Science 2620
Department of Mathematics & Computer Science
University of Lethbridge Home Page