Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Refer to the declaration of class Clock on the other sheet of paper Assume that clockh (header file), clock.cpp (implementation file) and test-clock.cpp (client

image text in transcribed
image text in transcribed
1. Refer to the declaration of class Clock on the other sheet of paper Assume that clockh (header file), clock.cpp (implementation file) and test-clock.cpp (client program) are used a (4 points) What does the statement Clock one; do? b. (4 points) Write a statement to create a Clock object with an initial time 20 minutes and 25 seconds after 10 am. Name the object two C (4 points) Refer to the object named two created in #b. Write a statement to display its current minute d (4 points) Use the Clock object one created in #a and write a statement to move the time forward 300 minutes. e. k4 points) Is the statement cout 5 syntactically correct? Justify your answer. (4 points) Refer to the array of objects (clocks) created in #i. Write the statement to determine whether the 4 clock is before noon. (10 points) Implement the first constructor. You need to include the function header in the definition k. 1 class Clock $ private: Sint hour int minute: int second bool clock_on 1/ holds hoor unit of current time 1/ holds minute wit of corrent time 1/ holds second unit of Current time H/ holds the state of the clock: on or of publie: Clock int new hour, int new sinate, int nev_second) Il precondition: new_hour is between 0 and 2a, new minute between 0 and 1/ 59. and second between 0 and 59 11 pontcondition: new hour is assigned to how, nev_minate assigned to 27 minute, new second assigned to second, and look on 17 is set to true Clock) 11 precondition: none // postcondition bour, minute, and second are set to ero and block_on H/ is set to true. void move forward fint amount) 77 move the current time forward by amount minutes void moveBackyard (int amount). 17 move the current time backward by amount minutes void surnClockor 77 tum eloek of I void tumnieckon) // turn clock on ant getMour) W return hour of current time int getNinute) 1 Eeten minute of current time ant gedecond) return toond of current bine bool sector return the state of cost o O Class Cox

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions