Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ code ... Test and make sure It runs... thank you Assignment 5 - Clock Direction: Submit the typed source code or git url. Building

C++ code ... Test and make sure It runs... thank you
image text in transcribed
image text in transcribed
image text in transcribed
Assignment 5 - Clock Direction: Submit the typed source code or git url. Building the Class For this assignment, you will create a clock that expresses time in hours, minutes and seconds; however, the class will only stores seconds passed midnight. For example, 1: 30:00 PM translates to 48, 600 seconds passed midnight. The general formula for caleulating seconds passed midnight is S=hr x 3600 + mn x 60 + sd where hr is hour (0- 23), mn is minutes (0-59) and sd is seconds (0-59) The class Clock should be stored in the header file "Clock.h" and should consist of o Private int field named seconds o Public default constructor that assigns 0 (midnight) to seconds. a Public overloaded constructor that takes an int as a parameter named seconds. It assigns seconds to the seconds field only if it is between 0 and 86399 inclusively; otherwise, it assigns 0 to the seconds field. o Public copy constructor that performs a shallow copy. a Public overloaded assignment operator that performs a shallow copy. o public constant get method for the hour. It should return the hour represented by seconds in 24-hour format (0 23 . o Public constant get method for the minute. It should return the minute represented by seconds in 24-hour format (0-59) Public constant get method for the second. It should return the second represented by seconds in 24-hour format (0-59). o Public set method for hour. If the parameter is between 0 and 23 inclusively, it should adjust seconds to the new hour a Public set method for minute. If the parameter is between 0 and 59 inclusively, it should adjust seconds to the new ds to the new while maintaining the minute and second; otherwise, it does nothing minute while maintaining the hour and second; otherwise, it does nothing

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

what is a syn flood attack

Answered: 1 week ago

Question

Prepare a short profile of Henry words worth Longfellow?

Answered: 1 week ago

Question

What is RAM as far as telecommunication is concerned?

Answered: 1 week ago

Question

Question 1: What is reproductive system? Question 2: What is Semen?

Answered: 1 week ago

Question

Describe the sources of long term financing.

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago