i need someone to do my program python asap

profilesas70
ExtraCredit01Chapter01.docx

CS 222 02

Extra Credit Assignment 01 Chapter 01

Up to 10 Points

Due: Monday, March 5, 2018

Create a class named Clock. The Clock class should have three attributes

· hour – represents the time hour and should be a value between 0 and 23

· minute – represents the time minute and should be a value between 0 and 59

· second – represents the time second and should be a value between 0 and 59

Methods should include:

· the constructor

· the appropriate accessors and mutators; be sure to include code in the mutators to make sure correct values are used

· increment method that increases second by 1; this should include code that will increase minute by 1 if second is greater than 59 and then change second back to 0. This should also be the same for minute to hour and hour back to 0.

· an __str__ to print the time in the format hh:mm:ss

Create a subclass of Clock called Alarm. Alarm should include the following attributes:

· alarmTime that is an object of the Clock class (if you cannot figure out how to do this, ask in class)

· alarmOn that is a Boolean value – True means alarm is on, False means alarm is off

· an __str__ to print the alarmTime and alarmOn values

The following methods should be created:

· setAlarm – this will use the Clock methods to set the alarmTime

· onOff – to turn the alarm on or off

Create a test program to set a Clock object and print the time and also set an alarmTime and print its values.

Add the following comments to the beginning of the program.

Name: Your Name

Class and Section: CS 222 02

Assignment: Extra Credit Assignment 01

Due Date: See above

Date Turned in:

Program Description: You write a short description of what the program will do

When you complete the program, do the following.

1. Turn in a printout of the source code

2. Create a folder with the following name: ECProgram 01

3. Copy your program and any related files to this folder

4. Copy the folder to the following location: I:\kopp\inbox\CS 222 02\your name where your name is a folder located in I:\kopp\inbox\CS 222 02.