Lez's home
MSc Degree
-
Next page
Object Oriented Programming & Design
Lesley Bullwer &
Mingguang Liu
MSc IT – Full Time
Summative Assignment 1
Use of Class Dial
March 2000
For: Terry Chapman
Assignment
These notes are taken from the assignment worksheet produced by course tutor, Terry Chapman, and are dated 16 February 1999.
Purpose
The purpose of this coursework is diagnostic and for grading purposes and will contribute 40% of the final marks for the module.
The areas being tested are:-
- Abstraction and Data Hiding
- Class specification and implementation
- Classes that have class objects as data members
- Constructors and destructors
- Operator overloading
- The use of inheritance for this assignment is not required.
Teams
This assignment is to be carried out by teams consisting of two students submitting a single assignment for the group.
Specification
A Dial is a representation of real-world objects such as one hand of a clock or a single dial of an electricity meter. Dials have the following attributes:-
- They have a number of divisions - 60 in the case of the minute 'dial' of a clock, 12 in the case of the hour 'dial' of a 12 hour clock, 10 in the case of a meter dial.
- They have an internal state representing the division the hand is currently pointing to, or the number currently being displayed by a meter dial. It is assumed that this state, unlike the hand of an analogue clock, cannot have a value that lies between two divisions, i.e. the hour hand points either to 4 or 5, not in between.
- When the hand goes past the last division on the dial, it returns to the first division, e.g. when the minute hand of a clock moves from 59 to 0, or when a meter dial moves from 9 to 0. The fact that it has passed through this state may need to be transmitted to other dials with which it is associated.
Implement a class Dial using header (.h) and implementation (.cpp) files. Test this class with the supplied test program testdial.cpp.
Implement a class Clock24 using header and implementation fiiles that represents a 24 hour clock by making use of 2 Dials - one for the miuntes and one for the hours. Test this class with the supplied test program testclk.cpp.
Your program should be a DOS executable and should not use screen manipulation functions.
Lez's home
MSc Degree
-
Next page
Copyright 2000 Lez Bullwer