Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN CLASS ASSIGNMENT USING CLASSES AND MEMBER BUNCTIONS DUE TODAY You should be able to finish this in about 45 minutes. The outline for the
IN CLASS ASSIGNMENT USING CLASSES AND MEMBER BUNCTIONS DUE TODAY You should be able to finish this in about 45 minutes. The outline for the following program has been created for you. Complete the program. The output should be centered and look "pretty". Use iomanip to make spacing easier Create a Time class that will accept a time and print it in either Universal format or in Standard format. Once class Time has been defined, it can be used as a type in object, array, pointer and reference declarations as follows: Time sunset; Time arrayOfTimes[ 5 ] Time &dinner!ime = sunset; Time *timePtr&dinnerTime, pointer to a Time object // object of type Time l array of 5 Time objects reference to a Time object The class definition: class Time public TimeO; // constructor void setTime( int, int, int); I set hour, minute and second void printUniversalO; void printStandardO; print time in universal-time format // print time in standard-time format private: int hour int minute int second: W0- 23 (24-hour clock format) 0-59 0-59 ;// end class Time The Time class member function definitions #include using std:setfill; using std::setw; // include definition of class Time from Time.h // Time constructor initializes each data member to zero. // Ensures all Time objects start in a consistent state #include "Timeh" Time::Time0 YOUR CODE GOES HERE 3 // end Time constructor
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