
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Programming & Problem Solving II; Subject: Computer Engr & Computer Sci; University: California State University - Long Beach; Term: Unknown 1989;
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

To introduce you to the use of C++ classes as abstract data types (ADTs) and make sure you can use functions, structs and I/O in C++. You must also design and manipulate a simple data abstraction for representing time on a 24-hour clock.
Write a C++ class called clock which implements an ADT for a 24-hour clock. Design and implement clock so that it represents the time of day. Represent the time as hours, minutes and seconds on a 24-hour clock. The hours, minutes and seconds are the private data members of the class that implements the ADT. Include at least two initialization operations: one that provides a default value for the time, and another that sets the time to a client-supplied value. These operations are the class’ constructors. Include the following operations:
the type Clock. The parameters to timeDiff will be two objects of type Clock. timeDiff returns the difference in seconds.
before the second object of the type Clock. The parameters to isEarlier will be two objects of type Clock. isEarlier returns False otherwise. You will be provided with a main program that tests your package.
Due Wednesday, September 13: Program Specifications and Initial Documentation Turn in your specifications for a modular design of this program. You should include program documentation and specifications for each function you will be using. Please see the class handout on program documentation. Note: Spelling and grammar are important. Due Wednesday, September 20: Completed C++ Program Turn in your completed C++ program during lab. You will be asked to demonstrate your program, and a simple quiz will be given on the basics of the program. Dr. Tracy Bradley Maples