Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Language is C++ undefined 2. Time 24 Hours Language: C++ Autocomplete Ready Define a class Time24, that has the private time, minutes, and seconds attributes.
Language is C++
undefined
2. Time 24 Hours Language: C++ Autocomplete Ready Define a class Time24, that has the private time, minutes, and seconds attributes. It has following functions: - Time24(int h, int m, int s) initializes the attributes, also supports default values. - Time24(int h, int m, int s, char p) initializes the attributes given in 12 hours format. p is given as 'a' or 'p', indicating if it's am/pm. - void add(Time24 time) adds the time to the current time of object. - void adjust() to adjust the time to a valid 24 hours, this function should do the adjustment. For code re- utilization purposes this function can be called from constructor, and add function. (should it be a private function?? Yes, probably it should be define in private scope, as this will be used internally inside the class) - void show() displays the time in 24 hours format. Make this function constant, so that can be called with constant object. 1 #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started