Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need this code in Time.h, Time.cpp and TimeDriver.cpp files. C++ question. For this assignment, you are going to create a class that represent a
I need this code in Time.h, Time.cpp and TimeDriver.cpp files.
C++ question.
For this assignment, you are going to create a class that represent a Time. The Time class has the following variables: unsigned int hour unsigned int minutes unsigned int seconds char amPm In addition, the time class has the following constructors and member methods: Time() - sets the time to 12:00 AM. In other words, hour gets assigned a value of 12 minutes gets assigned a value of 0 and seconds is assigned 0. Lastly amPm is assigned 'A! Time(unsigned int hour, unsigned int minutes, unsigned int seconds, char amPm): assign values to respective variables. You need to make sure hour is only assigned values of 1 - 12 minutes and seconds can only have values of 0 - 59 assigned. Finally the amPm char can also be assigned an 'A' or a 'P! Getters for each of the variables. These just return the value. Setters for each of the variables. Make sure to check that the input is in the correct range (see 2nd constructor for assignment restrictions). void displayStandard(): This function displays the time in the following format: HH:MM:SS AM or HH:MM:SS PM void displayMilitary(): This function displays the time in military time format. HH:MM:SS. Assume 12AM is 24:00: 00 Driver File Create a time object with the time 3:35:56 PM and display this object using the standard time format and the military time format. Then ask the user for an hour, minutes, seconds and A for am or P for pm. Store the time into a second Time object and display this time in both standard and military format. Submission Instructions Upload a zipped file with your Time.h, Time.cpp and TimeDriver.cpp files. If using Replit, please submit a link insteadStep 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