Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with the C++ code program please. Thank you, please show test to show it works. Mandatory Instructions In this lab, you will
I need help with the C++ code program please.
Thank you, please show test to show it works.
Mandatory Instructions In this lab, you will be creating a C++ program that uses a Time class. You will create lab7.h and lab7.cpp and lab7client.cpp. The Time class has two data members (hour and ninute) that represent military time, and the list of available member functions that are described in the table below where clock is an instantiated object of the Time class and the calls are being made from the client (main). It is important that you make the class Time and not time. There is already a time class in C Member function calls Time clock; Time clock(17, 20); Default constructor Initialize hour and minute to zero Overloaded constructor: Initialize hour and minute to parameters or to all zeros ifeither value is negative, or out of the range, greater than 23 for hours or g Set the object's hour and minute or set both to zeros if either one value is negative or hours is greater than 23 or minutes is greater than 59 Returns the hour for the obiect Adds one minute to the curent time (hint: account for 7:59 it should change to 8:00) or 23:59 it should change to the 0:00 than 59 for minutes. clock.setTime(17, 20); clock.getHour lays time in the form HH MM (note leading 0 may be needed) clockl+clock2 An overloaded + operator that adds two Time objects together An overloaded that checks if two Time objects are Once you have completed your class. Modify the client program timeclient epp by completing the following: READ THE COMMENTS CAREFULLY STARTING FROM THE TOP 1. Instantiate three Time objects named FreeTime, WrongTime and BGTime. Initialize WrongTime to 25:45 and BGTime to 7:30 during instantiation. 2. Write code to display all three times. 3. Have the user set time for the FreeTime object using the keyboard input. 4. Display curent FreeTime. 5. Add 150 minutes to your FreeTime object using your addOneMinute function and a loop 6. Display current FreeTime. 7. Instantiate another Time object, ErtraTime. Initialize it to 1 hour and 15 minutes using the overloaded constructor. Add ExtraTime to FreeTime display FreeTime before and after addition. S. display curent FreeTimeStep 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