Question: IN the app VISUAL STUDIO CODE, please complete the following. Without changing the makefile: flags = - std = c + + 1 7 -

IN the app VISUAL STUDIO CODE, please complete the following.
Without changing the makefile:
flags =-std=c++17-Wall -I .
timeofday.o : timeofday.cpp timeofday.h
g++$(flags)-c $<-I .
testtimeofday : testtimeofday.cpp timeofday.o
g++$(flags)$^-o $@
checkit : checkit.cpp
g++$(flags)$^-o $@
checktimeofday : testtimeofday checkit correct-testtimeofday.txt
testtimeofday >student-testtimeofday.txt
checkit 0
timeinterval.o : timeinterval.cpp timeinterval.h timeofday.h
g++$(flags)-c $<-I .
testtimeinterval : testtimeinterval.cpp timeinterval.o timeofday.o
g++$(flags)$^-o $@
checktimeinterval : testtimeinterval checkit correct-testtimeinterval.txt
testtimeinterval >student-testtimeinterval.txt
checkit 1
Task:
Create a TimeOfDay class that holds the hour, minute, and second of a time of day in private integer data members. The class will contain a constructor, a print function, and accessor and mutator functions for the private data members. Read the comments in the supplied timeofday.h header file for more detailed requirements. Initial tests for the functionality of the TimeOfDay class have been provided in the attached testtimeofday.cpp source file. If you place all of the attached files in the same directory, you can run the initial tests with command make checktimeofday. You are encouraged to create more rigorous tests. Create a TimeInterval class that has a start TimeOfDay object and an end TimeOfDay object as private data members. The class will include three constructors, a print function, and accessor and mutator functions for the private data members. Read the comments in the supplied timeinterval.h header file for more detailed requirements. Initial tests for the functionality of the TimeInterval class have been provided in the attached testtimeinteral.cpp source file. If you place all of the attached files in the same directory, you can run the initial tests with command make checktimeinterval. You are strongly encouraged to create more rigorous tests. Specifications -Add all code for the definition of the TimeOfDay class to the attached timeofday.h header file. -Include all of the necessary code for the TimeOfDay class, including the implementation of all of the public member functions, in the attached timeofday.cpp source file. -Add all code for the definition of the TimeInterval class to the attached timeinterval.h header file. -
timeofday.h: // Define a TimeOfDay class that has private integer data members for the
// The class should ensure that the data members always remain in a consistent
// state.
// Add a constructor to allow the user to initialize the hour, minute,
// and second, in that order, with default arguments of 0
// If an argument value is invalid, the corresponding data member should be
// initialized to zero. For example, TimeOfDay(9,87,13) should initialize
// the hour to 9, the minute to 0, and the second to 13.
// Add mutator functions SetHour, SetMinute, and SetSecond that set the
// data member if the argument is valid, and leave the data member unchanged
// if the argument is invalid.
// Add accessor functions GetHour, GetMinute, and GetSecond that return
// a copy of the value of the corresponding data member.
// Add a Print function that will output the TimeOfDay object to the standard
// output device using cout, ending with endl (to flush the output buffer and
// go to the next line).
// The Print function should take two bool parameters for whether or not to
// display the time in military time (i.e.24 hour format) and whether or
// not to display the seconds value.
// Both parameters should have default arguments of false.
// If the first argument is true, the time should print in military time (24
//hour format), and if the first argument is false, the time should print
//in a.m./p.m. format.
//For example 13:00:00 in military time is equivalent to 01:00:00 p.m.
//and 07:00:00 in military time is equivalent to 07:00:00 a.m.
// If the second argument is true, the output should display the seconds
//value and if the second argument is false, the output should omit (drop,
//don't round) the seconds component of the time.
// e.g. Print() output will be formated as hh:mm a.m. or hh:mm p.m.
//Print(true) output will be formated as hh:mm
//Print(true, true) output will be formated as hh:mm:ss
//Print(false, true) output will be formatted as
// hh:mm:ss a.m. or hh:mm:ss p.m.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!