Find Jobs
Hire Freelancers

Alarm Clock

$15-20 USD

In Progress
Posted about 21 years ago

$15-20 USD

Paid on delivery
Objectives: Practice implementation of C++ code using inheritance. Problem Description: This program should be implemented using Microsoft Visual C++ 6.0. (1) Develop a Clock class (2) Develop an AlarmClock class (3) Develop a driver program for the AlarmClock class Requirements: (1) Clock class This class displays the computer operating system time using the 24-hour format, e.g., 13:05:11. The display refreshes approximately every second. You may use the Sleep(int msec) function whose prototype is in to pause for one second before refreshing. (2) AlarmClock class This class inherits from the Clock class. The additional data member is the time at which the alarm message ("Time is up") will be displayed for five times. The internal presentation of the time in the class is the number of seconds since midnight of 1/1/1970. The AlarmClock continues to display the system time after the alarm message is displayed. (3) Driver program The driver program allows the user to specify the arguments for the alarm clock. It will utilize the AlarmClock class to demonstrate the functionality of the class. The command line for executing the program is something like this: alarmclock 15:20:30 (This will set the alarm off at 15:20:30.) (4) Adding any utility methods is your decision. Deliverables: (1) A floppy disk that contains .dsw, .dsp, .h and .cpp files; (2) Hardcopies of the .h, .cpp files and the output; (3) An envelope to hold both the floppy disk and the hardcopies. ## Deliverables References: (1) Sample code for getting command line arguments: int main(int argc, char *argv[]) { cout << "you have entered " << argc << " arguments" << endl; int i; for (i = 0; i < argc; i++) { cout << "argv[" << i << "] is: " << argv[i] << endl; } return 0; } Note that argv[i] is a char *, which points to a NULL-terminated string. If you need to convert such a string into a number, use the function atoi(). See Textbook p.874 for details. (2) About system time System time as the number of seconds since the midnight of 1/1/1970 can be obtained using the time() function. See the example from MSDN below: /* ASCTIME.C: This program places the system time * in the long integer aclock, translates it into the * structure newtime and then converts it to string * form for output, using the asctime function. */ #include #include struct tm *newtime; time_t aclock; void main( void ) { time( &aclock ); /* Get time in seconds */ newtime = localtime( &aclock ); /* Convert time to struct */ /* tm form */ /* Print local time as a string */ printf( "The current date and time are: %s", asctime( newtime ) ); } Output The current date and time are: Sun May 01 20:27:01 1994 (3) Use the asctime() function to extract the time in the hh:mm:ss format for display. ## Platform any OPERATING SYSTEM, MS WINDOWS 98 OR NEWER. PROGRAM MUST BE WRITTEN BY USING MICROSOFT VISUAL C++ 6.0.
Project ID: 2917471

About the project

2 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$7 USD in 14 days
5.0 (17 reviews)
3.6
3.6
2 freelancers are bidding on average $10 USD for this job
User Avatar
See private message.
$12.75 USD in 14 days
4.9 (92 reviews)
6.0
6.0

About the client

Flag of UNITED STATES
United States
5.0
2
Member since Mar 19, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.