Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write in c++ Exercises (30) 1. Given the ADT Time specification below design, implement, and test the member functions as indicated. Use a loop in
write in c++
Exercises (30) 1. Given the ADT Time specification below design, implement, and test the member functions as indicated. Use a loop in your test function that includes calls to tick() and printStandard to illustrate correct handling of minute and hour changes. Example output is shown below. Il time. #ifndef__TIME04 #define_TIME04_ class Time // Time abstract data type (ADT) private: int br: 11 hour - 0..23 (24-hour clock format) int min: // minute - 0..59 int sec; // second - 0..59 public: // default stec sets data members to zero, ensures consistent state Time(); Time(int n, int m, int s); // parameterized stec - calls setTime() // setTime() sets Time value using universal time; performs validity // checks on data values, replaces invalid values with zero void setTime(int n, int m, int *); void setHr(int h); // sets bry with validation void setMin(int m); // sets min, with validation void setSes(int s); // sets secs with validation int getSese) const; // return second value int getMin.) const; // return minute value int getirl) const; // return hour value void ecintuniversall) const; // print universal time format void printStandard) const; // print standard time format void tick(); // increments time one second, ensures consistent state #endif /* Example output: Universal time (default): 00:00:00 Standard time (default): 12:00:00 AM "16 bells" Universal time: 16:00:00 Standard time: 4:00:00 PM Step 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