SlideShare a Scribd company logo

C++ Please I am posting the fifth time and hoping to get th.pdf

J
jaipur2

C++ "Please I am posting the fifth time and hoping to get this resolved. I want the year to change from 2014 to 2015 but the days of the month change to 32 rather than 1/1/2015. Also, Please I want personal information in the heading as well Name: Last: and Course Name:" Modify the Time class(attached) to be able to work with Date class. The Time object should always remain in a consistent state. Modify the Date class(attached) to include a Time class object as a composition, a tick member function that increments the time stored in a Date object by one second, and increaseADay function to increase day, month and year when it is proper. Please use CISP400V10A4.cpp that tests the tick member function in a loop that prints the time in standard format during iteration of the loop to illustrate that the tick member function works correctly. Be aware that we are testing the following cases: a) Incrementing into the next minute. b) Incrementing into the next hour. c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM). d) Incrementing into the next month and next year. Time class The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)), minute (0 59), and second (0 59). It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute, getSecond,~Time, printUniversal, and printStandard public functions. 1. The Time function is a default constructor. It takes three integers and they all have 0 as default values. It also displays "Time object constructor is called." message and calls printStandard and printUniversal functions. 2. The setTime function takes three integers but does not return any value. It initializes the private data members (hour, minute and second) data. 3. The setHour function takes one integer but doesnt return anything. It validates and stores the integer to the hour private data member. 4. The setMinute function takes one integer but doesnt return anything. It validates and stores the integer to the minute private data member. 5. The setSecond function takes one integer but doesnt return anything. It validates and stores the integer to the second private data member. Page 3 of 11 CISP400V10A4 6. The getHour constant function returns one integer but doesnt take anything. It returns the private data member hours data. 7. The getMinute constant function returns one integer but doesnt take anything. It returns the private data member minutes data. 8. The getSecond constant function returns one integer but doesnt take anything. It returns the private data member seconds data. 9. The Time destructor does not take anything. It displays "Time object destructor is called." message and calls printStandard and printUniversal functions. 10. The printUniversal constant function does not return or accept anything. It displays time in universal-time format. 11. The printStandard constant function does not return or accept anything. It displays time in standard-ti.

1 of 7
Download to read offline
C++
"Please I am posting the fifth time and hoping to get this resolved. I want the year to
change from 2014 to 2015 but the days of the month change to 32 rather than 1/1/2015.
Also, Please I want personal information in the heading as well Name: Last: and Course
Name:"
Modify the Time class(attached) to be able to work with Date class. The Time object should
always
remain in a consistent state.
Modify the Date class(attached) to include a Time class object as a composition, a tick member
function that increments the time stored in a Date object by one second, and increaseADay
function to
increase day, month and year when it is proper. Please use CISP400V10A4.cpp that tests the tick
member function in a loop that prints the time in standard format during iteration of the loop to
illustrate that the tick member function works correctly. Be aware that we are testing the following
cases:
a) Incrementing into the next minute.
b) Incrementing into the next hour.
c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
d) Incrementing into the next month and next year.
Time class
The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)),
minute (0
59), and second (0 59).
It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute,
getSecond,~Time,
printUniversal, and printStandard public functions.
1. The Time function is a default constructor. It takes three integers and they all have 0 as default
values. It also displays "Time object constructor is called." message and calls
printStandard
and printUniversal functions.
2. The setTime function takes three integers but does not return any value. It initializes the
private data members (hour, minute and second) data.
3. The setHour function takes one integer but doesnt return anything. It validates and stores the
integer to the hour private data member.
4. The setMinute function takes one integer but doesnt return anything. It validates and stores
the integer to the minute private data member.
5. The setSecond function takes one integer but doesnt return anything. It validates and stores
the integer to the second private data member.
Page 3 of 11 CISP400V10A4
6. The getHour constant function returns one integer but doesnt take anything. It returns the
private data member hours data.
7. The getMinute constant function returns one integer but doesnt take anything. It returns the
private data member minutes data.
8. The getSecond constant function returns one integer but doesnt take anything. It returns the
private data member seconds data.
9. The Time destructor does not take anything. It displays "Time object destructor is
called."
message and calls printStandard and printUniversal functions.
10. The printUniversal constant function does not return or accept anything. It displays time in
universal-time format.
11. The printStandard constant function does not return or accept anything. It displays time in
standard-time format.
Date class
The Date class has three private integer data members (month, day and year), one private Time
object
(time) data member and one static constant integer variable (monthsPerYear).
It has Date, print, increaseADay, tick, and ~Date public functions. It has one private checkDay
function.
1. The Date function is a default constructor. It takes 3 integers and one Time object. The
three integers have default data (1, 2, and 1900) and the Time has (0, 0, and 0) as default
data. It displays "Date object constructor for date" information when the constructor is
called.
2. The print constant function does not take or return data. It prints out the month day year,
hour, minute and second information.
3. The increaseADay function does not take or return data. It increases the private data
member day by one. It also checks the day to make sure the data is accurate. If the data is
not accurate it will adjust all the necessary corresponding data.
4. The tick function does not takes or return data. It increases one second to the Time object
of the Date class private data member. This function has to make sure that the second
increased is proper or it will adjust all the necessary corresponding data.
5. The ~Date function is a destructor of the Date class. It also displays "Date object
destructor
is called "; message and calls Time object destructor.
6. The constant checkDay function takes and returns an integer. It makes sure the accuracy of
day, month, and year information. This utility function to confirm proper day value based
on month and year, it also handles leap years, too.
Page 4 of 11 CISP400V10A4
This assignment comes with a CISP400V10A4.zip file. It includes six files (CISP400V10A4.cpp,
CISP400V10A4.exe, Date.cpp, Date.h, Time.cpp and Time.h). The CISP400V10A4.exe file is an
executable file. You can double click the file to get to the expecting result (see the picture below)
of
this assignment. The Date.cpp, Date.h, Time.cpp, and Time.h are files that you can use so you
dont
need to start from scratch. After you finish your implementation for the Date and Time class, you
can
put the CISP400V10A4.cpp, Date.cpp, Date.h, Time.cpp, and Time.h in a project and then you
can run
to the same result as the CISP400V10A4.exe. Please be awarded that you can adjust only your
program (Date.cpp, Date.h, Time.cpp and Time.h) to generate the required result but not the code
in
CISP400V10A4.cpp file.
The following are the couple displays of the expecting results.
// Date.h
// Date class definition; Member functions defined in Date.cpp
#ifndef DATE_H
#define DATE_H
class Date
{
public:
static const unsigned int monthsPerYear = 12; // months in a year
explicit Date( int = 1, int = 1, int = 1900 ); // default constructor
void print() const; // print date in month/day/year format
~Date(); // provided to confirm destruction order
private:
unsigned int month; // 1-12 (January-December)
unsigned int day; // 1-31 based on month
unsigned int year; // any year
// utility function to check if day is proper for month and year
unsigned int checkDay( int ) const;
}; // end class Date
#endif
// Time.h
// Time class containing a constructor with default arguments.
// Member functions defined in Time.cpp.
// prevent multiple inclusions of header
#ifndef TIME_H
#define TIME_H
// Time class definition
class Time
{
public:
explicit Time( int = 0, int = 0, int = 0 ); // default constructor
// set functions
void setTime( int, int, int ); // set hour, minute, second
void setHour( int ); // set hour (after validation)
void setMinute( int ); // set minute (after validation)
void setSecond( int ); // set second (after validation)
// get functions
unsigned int getHour() const; // return hour
unsigned int getMinute() const; // return minute
unsigned int getSecond() const; // return second
void printUniversal() const; // output time in universal-time format
void printStandard() const; // output time in standard-time format
private:
unsigned int hour; // 0 - 23 (24-hour clock format)
unsigned int minute; // 0 - 59
unsigned int second; // 0 - 59
}; // end class Time
#endif
// CISP400V10A4.cpp
#include <iostream>
using std::cout;
using std::endl;
#include "Time.h" // include Time class definition
#include "Date.h" // include Date class definition
const int MAX_TICKS = 30000;
int main()
{
Time t(23, 59, 58);// create a time object
Date d(12, 31, 2017, t); // create date object
// output Time object t's values
for ( int ticks = 1; ticks < MAX_TICKS; ++ticks )
{
d.print(); // invokes print
cout << endl;
d.tick(); // invokes function tick
} // end for
d.~Date();// call Date destructor
system("PAUSE");
return 0;
} // end main
// Date.cpp
// Date class member-function definitions.
#include <array>
#include <iostream>
#include <stdexcept>
#include "Date.h" // include Date class definition
using namespace std;
// constructor confirms proper value for month; calls
// utility function checkDay to confirm proper value for day
Date::Date( int mn, int dy, int yr )
{
if ( mn > 0 && mn <= monthsPerYear ) // validate the month
month = mn;
else
throw invalid_argument( "month must be 1-12" );
year = yr; // could validate yr
day = checkDay( dy ); // validate the day
// output Date object to show when its constructor is called
cout << "Date object constructor for date ";
print();
cout << endl;
} // end Date constructor
// print Date object in form month/day/year
void Date::print() const
{
cout << month << '/' << day << '/' << year;
} // end function print
// output Date object to show when its destructor is called
Date::~Date()
{
cout << "Date object destructor for date ";
print();
cout << endl;
} // end ~Date destructor
// utility function to confirm proper day value based on
// month and year; handles leap years, too
unsigned int Date::checkDay( int testDay ) const
{
static const array< int, monthsPerYear + 1 > daysPerMonth =
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
// determine whether testDay is valid for specified month
if ( testDay > 0 && testDay <= daysPerMonth[ month ] )
return testDay;
// February 29 check for leap year
if ( month == 2 && testDay == 29 && ( year % 400 == 0 ||
( year % 4 == 0 && year % 100 != 0 ) ) )
return testDay;
throw invalid_argument( "Invalid day for current month and year" );
} // end function checkDay
// Time.cpp
// Member-function definitions for class Time.
#include <iostream>
#include <iomanip>
#include <stdexcept>
#include "Time.h" // include definition of class Time from Time.h
using namespace std;
// Time constructor initializes each data member
Time::Time( int hour, int minute, int second )
{
setTime( hour, minute, second ); // validate and set time
} // end Time constructor
// set new Time value using universal time
void Time::setTime( int h, int m, int s )
{
setHour( h ); // set private field hour
setMinute( m ); // set private field minute
setSecond( s ); // set private field second
} // end function setTime
// set hour value
void Time::setHour( int h )
{
if ( h >= 0 && h < 24 )
hour = h;
else
throw invalid_argument( "hour must be 0-23" );
} // end function setHour
// set minute value
void Time::setMinute( int m )
{
if ( m >= 0 && m < 60 )
minute = m;
else
throw invalid_argument( "minute must be 0-59" );
} // end function setMinute
// set second value
void Time::setSecond( int s )
{
if ( s >= 0 && s < 60 )
second = s;
else
throw invalid_argument( "second must be 0-59" );

Recommended

Milestone 2 Start the second milestone by creating a gener.pdf
 Milestone 2 Start the second milestone by creating a gener.pdf Milestone 2 Start the second milestone by creating a gener.pdf
Milestone 2 Start the second milestone by creating a gener.pdfajay1317
 
enum_comp_exercicio01.docx
enum_comp_exercicio01.docxenum_comp_exercicio01.docx
enum_comp_exercicio01.docxMichel Valentim
 
friends functionToshu
friends functionToshufriends functionToshu
friends functionToshuSidd Singh
 
27- System Funciton in Azure Data Factory.pptx
27- System Funciton in Azure Data Factory.pptx27- System Funciton in Azure Data Factory.pptx
27- System Funciton in Azure Data Factory.pptxBRIJESH KUMAR
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportMatthew Zackschewski
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answersQuratulain Naqvi
 
Assignment Java Programming 2
Assignment Java Programming 2Assignment Java Programming 2
Assignment Java Programming 2Kaela Johnson
 
Csphtp1 08
Csphtp1 08Csphtp1 08
Csphtp1 08HUST
 

More Related Content

Similar to C++ Please I am posting the fifth time and hoping to get th.pdf

Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4Synapseindiappsdevelopment
 
you will be writing two objects to heuristically compare the perform.pdf
you will be writing two objects to heuristically compare the perform.pdfyou will be writing two objects to heuristically compare the perform.pdf
you will be writing two objects to heuristically compare the perform.pdfbadshetoms
 
I have already implement the Department, Employee, Project and Wor.pdf
I have already implement the Department, Employee, Project and Wor.pdfI have already implement the Department, Employee, Project and Wor.pdf
I have already implement the Department, Employee, Project and Wor.pdfaggarwalshoppe14
 
Please divide it into 5 files while maintaining the existing function (1).pdf
Please divide it into 5 files while maintaining the existing function (1).pdfPlease divide it into 5 files while maintaining the existing function (1).pdf
Please divide it into 5 files while maintaining the existing function (1).pdfa1salesagency
 
Desiqn an abstract data type called Weather that keeps track of t.pdf
Desiqn an abstract data type called Weather that keeps track of t.pdfDesiqn an abstract data type called Weather that keeps track of t.pdf
Desiqn an abstract data type called Weather that keeps track of t.pdfinfo824691
 
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)Igalia
 
Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6helpido9
 
Classes and data abstraction
Classes and data abstractionClasses and data abstraction
Classes and data abstractionHoang Nguyen
 
Ch10 Program Organization
Ch10 Program OrganizationCh10 Program Organization
Ch10 Program OrganizationSzeChingChen
 
Java22_1670144363.pptx
Java22_1670144363.pptxJava22_1670144363.pptx
Java22_1670144363.pptxDilanAlmsa
 
C++ project
C++ projectC++ project
C++ projectSonu S S
 
You need to create two classes Scheduler and Job. Normally these two.docx
 You need to create two classes Scheduler and Job. Normally these two.docx You need to create two classes Scheduler and Job. Normally these two.docx
You need to create two classes Scheduler and Job. Normally these two.docxajoy21
 
Php date &amp; time functions
Php date &amp; time functionsPhp date &amp; time functions
Php date &amp; time functionsProgrammer Blog
 

Similar to C++ Please I am posting the fifth time and hoping to get th.pdf (20)

Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
you will be writing two objects to heuristically compare the perform.pdf
you will be writing two objects to heuristically compare the perform.pdfyou will be writing two objects to heuristically compare the perform.pdf
you will be writing two objects to heuristically compare the perform.pdf
 
I have already implement the Department, Employee, Project and Wor.pdf
I have already implement the Department, Employee, Project and Wor.pdfI have already implement the Department, Employee, Project and Wor.pdf
I have already implement the Department, Employee, Project and Wor.pdf
 
Please divide it into 5 files while maintaining the existing function (1).pdf
Please divide it into 5 files while maintaining the existing function (1).pdfPlease divide it into 5 files while maintaining the existing function (1).pdf
Please divide it into 5 files while maintaining the existing function (1).pdf
 
lecture10.ppt
lecture10.pptlecture10.ppt
lecture10.ppt
 
lecture10.ppt
lecture10.pptlecture10.ppt
lecture10.ppt
 
PROGRAMMING QUESTIONS.docx
PROGRAMMING QUESTIONS.docxPROGRAMMING QUESTIONS.docx
PROGRAMMING QUESTIONS.docx
 
Desiqn an abstract data type called Weather that keeps track of t.pdf
Desiqn an abstract data type called Weather that keeps track of t.pdfDesiqn an abstract data type called Weather that keeps track of t.pdf
Desiqn an abstract data type called Weather that keeps track of t.pdf
 
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)
 
Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6
 
Classes and data abstraction
Classes and data abstractionClasses and data abstraction
Classes and data abstraction
 
C chap16
C chap16C chap16
C chap16
 
Ch10 Program Organization
Ch10 Program OrganizationCh10 Program Organization
Ch10 Program Organization
 
Java22_1670144363.pptx
Java22_1670144363.pptxJava22_1670144363.pptx
Java22_1670144363.pptx
 
E7
E7E7
E7
 
C++ project
C++ projectC++ project
C++ project
 
You need to create two classes Scheduler and Job. Normally these two.docx
 You need to create two classes Scheduler and Job. Normally these two.docx You need to create two classes Scheduler and Job. Normally these two.docx
You need to create two classes Scheduler and Job. Normally these two.docx
 
Php date &amp; time functions
Php date &amp; time functionsPhp date &amp; time functions
Php date &amp; time functions
 
Computer programming 2 Lesson 14
Computer programming 2  Lesson 14Computer programming 2  Lesson 14
Computer programming 2 Lesson 14
 

More from jaipur2

Business organizations are relying more and more on social m.pdf
Business organizations are relying more and more on social m.pdfBusiness organizations are relying more and more on social m.pdf
Business organizations are relying more and more on social m.pdfjaipur2
 
Bu yaz kamyonu farkl yerel topluluk etkinliklerine gtryor.pdf
Bu yaz kamyonu farkl yerel topluluk etkinliklerine gtryor.pdfBu yaz kamyonu farkl yerel topluluk etkinliklerine gtryor.pdf
Bu yaz kamyonu farkl yerel topluluk etkinliklerine gtryor.pdfjaipur2
 
Budget Analysis A budget is an expression of managements e.pdf
Budget Analysis A budget is an expression of managements e.pdfBudget Analysis A budget is an expression of managements e.pdf
Budget Analysis A budget is an expression of managements e.pdfjaipur2
 
BUSINESS LAW QUESTION Question 2 Ashik owns a landed pr.pdf
BUSINESS LAW QUESTION Question 2     Ashik owns a landed pr.pdfBUSINESS LAW QUESTION Question 2     Ashik owns a landed pr.pdf
BUSINESS LAW QUESTION Question 2 Ashik owns a landed pr.pdfjaipur2
 
Bu altrma Boston konut veri setini ierir a Balamak iin.pdf
Bu altrma Boston konut veri setini ierir a Balamak iin.pdfBu altrma Boston konut veri setini ierir a Balamak iin.pdf
Bu altrma Boston konut veri setini ierir a Balamak iin.pdfjaipur2
 
Bu snf arkadamn yazd bir tartma gnderisidir Yant vermem.pdf
Bu snf arkadamn yazd bir tartma gnderisidir  Yant vermem.pdfBu snf arkadamn yazd bir tartma gnderisidir  Yant vermem.pdf
Bu snf arkadamn yazd bir tartma gnderisidir Yant vermem.pdfjaipur2
 
Bu senaryo bir geici zm en iyi ekilde aklar Etkili.pdf
Bu senaryo bir geici zm en iyi ekilde aklar   Etkili.pdfBu senaryo bir geici zm en iyi ekilde aklar   Etkili.pdf
Bu senaryo bir geici zm en iyi ekilde aklar Etkili.pdfjaipur2
 
Bu ifadelerin her birinin doru mu yoksa yanl m olduuna karar.pdf
Bu ifadelerin her birinin doru mu yoksa yanl m olduuna karar.pdfBu ifadelerin her birinin doru mu yoksa yanl m olduuna karar.pdf
Bu ifadelerin her birinin doru mu yoksa yanl m olduuna karar.pdfjaipur2
 
C++ ONLY Write a program that will keep track of information.pdf
C++ ONLY Write a program that will keep track of information.pdfC++ ONLY Write a program that will keep track of information.pdf
C++ ONLY Write a program that will keep track of information.pdfjaipur2
 
C++ only plz Write a function that takes two arguments and .pdf
C++ only  plz Write a function that takes two arguments and .pdfC++ only  plz Write a function that takes two arguments and .pdf
C++ only plz Write a function that takes two arguments and .pdfjaipur2
 
c++ please Write a recursive function that takes a string pa.pdf
c++ please Write a recursive function that takes a string pa.pdfc++ please Write a recursive function that takes a string pa.pdf
c++ please Write a recursive function that takes a string pa.pdfjaipur2
 
C The following payoff for three mutually exclusive projec.pdf
C The following payoff for three mutually exclusive projec.pdfC The following payoff for three mutually exclusive projec.pdf
C The following payoff for three mutually exclusive projec.pdfjaipur2
 
C++ only 319 LAB Exact change Write a program with total c.pdf
C++ only 319 LAB Exact change Write a program with total c.pdfC++ only 319 LAB Exact change Write a program with total c.pdf
C++ only 319 LAB Exact change Write a program with total c.pdfjaipur2
 
C++ pleae Your welcome DoublyLinkedList thisgthea.pdf
C++ pleae  Your welcome DoublyLinkedList  thisgthea.pdfC++ pleae  Your welcome DoublyLinkedList  thisgthea.pdf
C++ pleae Your welcome DoublyLinkedList thisgthea.pdfjaipur2
 
C++ is a highlevel programming language that consists of v.pdf
C++ is a highlevel programming language that consists of v.pdfC++ is a highlevel programming language that consists of v.pdf
C++ is a highlevel programming language that consists of v.pdfjaipur2
 
C++ Define a function unbalanced brackets that takes in a st.pdf
C++ Define a function unbalanced brackets that takes in a st.pdfC++ Define a function unbalanced brackets that takes in a st.pdf
C++ Define a function unbalanced brackets that takes in a st.pdfjaipur2
 
C++ The following code fragment will no compile What is w.pdf
C++   The following code fragment will no compile What is w.pdfC++   The following code fragment will no compile What is w.pdf
C++ The following code fragment will no compile What is w.pdfjaipur2
 
c What saving rate is needed to yield the goldenrule capi.pdf
c What saving rate is needed to yield the goldenrule capi.pdfc What saving rate is needed to yield the goldenrule capi.pdf
c What saving rate is needed to yield the goldenrule capi.pdfjaipur2
 
c++ Write the implementations of two functions to carry o.pdf
c++    Write the implementations of two functions to carry o.pdfc++    Write the implementations of two functions to carry o.pdf
c++ Write the implementations of two functions to carry o.pdfjaipur2
 
C++ Write a program that will keep track of information ab.pdf
C++   Write a program that will keep track of information ab.pdfC++   Write a program that will keep track of information ab.pdf
C++ Write a program that will keep track of information ab.pdfjaipur2
 

More from jaipur2 (20)

Business organizations are relying more and more on social m.pdf
Business organizations are relying more and more on social m.pdfBusiness organizations are relying more and more on social m.pdf
Business organizations are relying more and more on social m.pdf
 
Bu yaz kamyonu farkl yerel topluluk etkinliklerine gtryor.pdf
Bu yaz kamyonu farkl yerel topluluk etkinliklerine gtryor.pdfBu yaz kamyonu farkl yerel topluluk etkinliklerine gtryor.pdf
Bu yaz kamyonu farkl yerel topluluk etkinliklerine gtryor.pdf
 
Budget Analysis A budget is an expression of managements e.pdf
Budget Analysis A budget is an expression of managements e.pdfBudget Analysis A budget is an expression of managements e.pdf
Budget Analysis A budget is an expression of managements e.pdf
 
BUSINESS LAW QUESTION Question 2 Ashik owns a landed pr.pdf
BUSINESS LAW QUESTION Question 2     Ashik owns a landed pr.pdfBUSINESS LAW QUESTION Question 2     Ashik owns a landed pr.pdf
BUSINESS LAW QUESTION Question 2 Ashik owns a landed pr.pdf
 
Bu altrma Boston konut veri setini ierir a Balamak iin.pdf
Bu altrma Boston konut veri setini ierir a Balamak iin.pdfBu altrma Boston konut veri setini ierir a Balamak iin.pdf
Bu altrma Boston konut veri setini ierir a Balamak iin.pdf
 
Bu snf arkadamn yazd bir tartma gnderisidir Yant vermem.pdf
Bu snf arkadamn yazd bir tartma gnderisidir  Yant vermem.pdfBu snf arkadamn yazd bir tartma gnderisidir  Yant vermem.pdf
Bu snf arkadamn yazd bir tartma gnderisidir Yant vermem.pdf
 
Bu senaryo bir geici zm en iyi ekilde aklar Etkili.pdf
Bu senaryo bir geici zm en iyi ekilde aklar   Etkili.pdfBu senaryo bir geici zm en iyi ekilde aklar   Etkili.pdf
Bu senaryo bir geici zm en iyi ekilde aklar Etkili.pdf
 
Bu ifadelerin her birinin doru mu yoksa yanl m olduuna karar.pdf
Bu ifadelerin her birinin doru mu yoksa yanl m olduuna karar.pdfBu ifadelerin her birinin doru mu yoksa yanl m olduuna karar.pdf
Bu ifadelerin her birinin doru mu yoksa yanl m olduuna karar.pdf
 
C++ ONLY Write a program that will keep track of information.pdf
C++ ONLY Write a program that will keep track of information.pdfC++ ONLY Write a program that will keep track of information.pdf
C++ ONLY Write a program that will keep track of information.pdf
 
C++ only plz Write a function that takes two arguments and .pdf
C++ only  plz Write a function that takes two arguments and .pdfC++ only  plz Write a function that takes two arguments and .pdf
C++ only plz Write a function that takes two arguments and .pdf
 
c++ please Write a recursive function that takes a string pa.pdf
c++ please Write a recursive function that takes a string pa.pdfc++ please Write a recursive function that takes a string pa.pdf
c++ please Write a recursive function that takes a string pa.pdf
 
C The following payoff for three mutually exclusive projec.pdf
C The following payoff for three mutually exclusive projec.pdfC The following payoff for three mutually exclusive projec.pdf
C The following payoff for three mutually exclusive projec.pdf
 
C++ only 319 LAB Exact change Write a program with total c.pdf
C++ only 319 LAB Exact change Write a program with total c.pdfC++ only 319 LAB Exact change Write a program with total c.pdf
C++ only 319 LAB Exact change Write a program with total c.pdf
 
C++ pleae Your welcome DoublyLinkedList thisgthea.pdf
C++ pleae  Your welcome DoublyLinkedList  thisgthea.pdfC++ pleae  Your welcome DoublyLinkedList  thisgthea.pdf
C++ pleae Your welcome DoublyLinkedList thisgthea.pdf
 
C++ is a highlevel programming language that consists of v.pdf
C++ is a highlevel programming language that consists of v.pdfC++ is a highlevel programming language that consists of v.pdf
C++ is a highlevel programming language that consists of v.pdf
 
C++ Define a function unbalanced brackets that takes in a st.pdf
C++ Define a function unbalanced brackets that takes in a st.pdfC++ Define a function unbalanced brackets that takes in a st.pdf
C++ Define a function unbalanced brackets that takes in a st.pdf
 
C++ The following code fragment will no compile What is w.pdf
C++   The following code fragment will no compile What is w.pdfC++   The following code fragment will no compile What is w.pdf
C++ The following code fragment will no compile What is w.pdf
 
c What saving rate is needed to yield the goldenrule capi.pdf
c What saving rate is needed to yield the goldenrule capi.pdfc What saving rate is needed to yield the goldenrule capi.pdf
c What saving rate is needed to yield the goldenrule capi.pdf
 
c++ Write the implementations of two functions to carry o.pdf
c++    Write the implementations of two functions to carry o.pdfc++    Write the implementations of two functions to carry o.pdf
c++ Write the implementations of two functions to carry o.pdf
 
C++ Write a program that will keep track of information ab.pdf
C++   Write a program that will keep track of information ab.pdfC++   Write a program that will keep track of information ab.pdf
C++ Write a program that will keep track of information ab.pdf
 

Recently uploaded

EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...liera silvan
 
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...AKSHAYMAGAR17
 
A LABORATORY MANUAL FOR ORGANIC CHEMISTRY.pdf
A LABORATORY MANUAL FOR ORGANIC CHEMISTRY.pdfA LABORATORY MANUAL FOR ORGANIC CHEMISTRY.pdf
A LABORATORY MANUAL FOR ORGANIC CHEMISTRY.pdfDr.M.Geethavani
 
MEC MAJUBA SADDENED BY THE PASSING AWAY OF THREE TEACHERS FOLLOWING A CAR ACC...
MEC MAJUBA SADDENED BY THE PASSING AWAY OF THREE TEACHERS FOLLOWING A CAR ACC...MEC MAJUBA SADDENED BY THE PASSING AWAY OF THREE TEACHERS FOLLOWING A CAR ACC...
MEC MAJUBA SADDENED BY THE PASSING AWAY OF THREE TEACHERS FOLLOWING A CAR ACC...SABC News
 
Discussing the new Competence Framework for project managers in the built env...
Discussing the new Competence Framework for project managers in the built env...Discussing the new Competence Framework for project managers in the built env...
Discussing the new Competence Framework for project managers in the built env...Association for Project Management
 
Unit 5th topic Drugs used in congestive Heart failure and shock.pdf
Unit 5th topic Drugs used in congestive Heart failure and shock.pdfUnit 5th topic Drugs used in congestive Heart failure and shock.pdf
Unit 5th topic Drugs used in congestive Heart failure and shock.pdfSUMIT TIWARI
 
Plagiarism, Types & Consequences by Dr. Sarita Anand
Plagiarism, Types & Consequences by Dr. Sarita AnandPlagiarism, Types & Consequences by Dr. Sarita Anand
Plagiarism, Types & Consequences by Dr. Sarita AnandDr. Sarita Anand
 
Successful projects and failed programmes – the cost of not designing the who...
Successful projects and failed programmes – the cost of not designing the who...Successful projects and failed programmes – the cost of not designing the who...
Successful projects and failed programmes – the cost of not designing the who...Association for Project Management
 
2.27.24 Malcolm X and the Black Freedom Struggle.pptx
2.27.24 Malcolm X and the Black Freedom Struggle.pptx2.27.24 Malcolm X and the Black Freedom Struggle.pptx
2.27.24 Malcolm X and the Black Freedom Struggle.pptxMaryPotorti1
 
Kartik Nair In Media Res Media Component
Kartik Nair In Media Res Media ComponentKartik Nair In Media Res Media Component
Kartik Nair In Media Res Media ComponentInMediaRes1
 
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Aggregage
 
ADAPTABILITY, Types of Adaptability AND STABILITY ANALYSIS method.pptx
ADAPTABILITY, Types of Adaptability AND STABILITY ANALYSIS  method.pptxADAPTABILITY, Types of Adaptability AND STABILITY ANALYSIS  method.pptx
ADAPTABILITY, Types of Adaptability AND STABILITY ANALYSIS method.pptxAKSHAYMAGAR17
 
CATCH UP FRIDAY LESSON PLAN GRADE 6.docx
CATCH UP FRIDAY LESSON PLAN GRADE 6.docxCATCH UP FRIDAY LESSON PLAN GRADE 6.docx
CATCH UP FRIDAY LESSON PLAN GRADE 6.docxAizaPolinarCruz
 
How To Create Record Rules in the Odoo 17
How To Create Record Rules in the Odoo 17How To Create Record Rules in the Odoo 17
How To Create Record Rules in the Odoo 17Celine George
 
Bilingual notes of Pharmacognosy chapter 4Glycosides, Volatile oils,Tannins,R...
Bilingual notes of Pharmacognosy chapter 4Glycosides, Volatile oils,Tannins,R...Bilingual notes of Pharmacognosy chapter 4Glycosides, Volatile oils,Tannins,R...
Bilingual notes of Pharmacognosy chapter 4Glycosides, Volatile oils,Tannins,R...SUMIT TIWARI
 
Decision on Curriculum Change Path: Towards Standards-Based Curriculum in Ghana
Decision on Curriculum Change Path: Towards Standards-Based Curriculum in GhanaDecision on Curriculum Change Path: Towards Standards-Based Curriculum in Ghana
Decision on Curriculum Change Path: Towards Standards-Based Curriculum in GhanaPrince Armah, PhD
 
Learner Digital Skills Toolkit DRAFT.docx
Learner Digital Skills Toolkit DRAFT.docxLearner Digital Skills Toolkit DRAFT.docx
Learner Digital Skills Toolkit DRAFT.docxGeorgeMilliken2
 
Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)CaraSkikne1
 

Recently uploaded (20)

EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
 
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
 
A LABORATORY MANUAL FOR ORGANIC CHEMISTRY.pdf
A LABORATORY MANUAL FOR ORGANIC CHEMISTRY.pdfA LABORATORY MANUAL FOR ORGANIC CHEMISTRY.pdf
A LABORATORY MANUAL FOR ORGANIC CHEMISTRY.pdf
 
MEC MAJUBA SADDENED BY THE PASSING AWAY OF THREE TEACHERS FOLLOWING A CAR ACC...
MEC MAJUBA SADDENED BY THE PASSING AWAY OF THREE TEACHERS FOLLOWING A CAR ACC...MEC MAJUBA SADDENED BY THE PASSING AWAY OF THREE TEACHERS FOLLOWING A CAR ACC...
MEC MAJUBA SADDENED BY THE PASSING AWAY OF THREE TEACHERS FOLLOWING A CAR ACC...
 
Discussing the new Competence Framework for project managers in the built env...
Discussing the new Competence Framework for project managers in the built env...Discussing the new Competence Framework for project managers in the built env...
Discussing the new Competence Framework for project managers in the built env...
 
Unit 5th topic Drugs used in congestive Heart failure and shock.pdf
Unit 5th topic Drugs used in congestive Heart failure and shock.pdfUnit 5th topic Drugs used in congestive Heart failure and shock.pdf
Unit 5th topic Drugs used in congestive Heart failure and shock.pdf
 
Plagiarism, Types & Consequences by Dr. Sarita Anand
Plagiarism, Types & Consequences by Dr. Sarita AnandPlagiarism, Types & Consequences by Dr. Sarita Anand
Plagiarism, Types & Consequences by Dr. Sarita Anand
 
Successful projects and failed programmes – the cost of not designing the who...
Successful projects and failed programmes – the cost of not designing the who...Successful projects and failed programmes – the cost of not designing the who...
Successful projects and failed programmes – the cost of not designing the who...
 
2.27.24 Malcolm X and the Black Freedom Struggle.pptx
2.27.24 Malcolm X and the Black Freedom Struggle.pptx2.27.24 Malcolm X and the Black Freedom Struggle.pptx
2.27.24 Malcolm X and the Black Freedom Struggle.pptx
 
Kartik Nair In Media Res Media Component
Kartik Nair In Media Res Media ComponentKartik Nair In Media Res Media Component
Kartik Nair In Media Res Media Component
 
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
 
ADAPTABILITY, Types of Adaptability AND STABILITY ANALYSIS method.pptx
ADAPTABILITY, Types of Adaptability AND STABILITY ANALYSIS  method.pptxADAPTABILITY, Types of Adaptability AND STABILITY ANALYSIS  method.pptx
ADAPTABILITY, Types of Adaptability AND STABILITY ANALYSIS method.pptx
 
CLUBE PERLINGUAS .
CLUBE PERLINGUAS                        .CLUBE PERLINGUAS                        .
CLUBE PERLINGUAS .
 
CATCH UP FRIDAY LESSON PLAN GRADE 6.docx
CATCH UP FRIDAY LESSON PLAN GRADE 6.docxCATCH UP FRIDAY LESSON PLAN GRADE 6.docx
CATCH UP FRIDAY LESSON PLAN GRADE 6.docx
 
How To Create Record Rules in the Odoo 17
How To Create Record Rules in the Odoo 17How To Create Record Rules in the Odoo 17
How To Create Record Rules in the Odoo 17
 
Bilingual notes of Pharmacognosy chapter 4Glycosides, Volatile oils,Tannins,R...
Bilingual notes of Pharmacognosy chapter 4Glycosides, Volatile oils,Tannins,R...Bilingual notes of Pharmacognosy chapter 4Glycosides, Volatile oils,Tannins,R...
Bilingual notes of Pharmacognosy chapter 4Glycosides, Volatile oils,Tannins,R...
 
Advance Mobile Application Development class 04
Advance Mobile Application Development class 04Advance Mobile Application Development class 04
Advance Mobile Application Development class 04
 
Decision on Curriculum Change Path: Towards Standards-Based Curriculum in Ghana
Decision on Curriculum Change Path: Towards Standards-Based Curriculum in GhanaDecision on Curriculum Change Path: Towards Standards-Based Curriculum in Ghana
Decision on Curriculum Change Path: Towards Standards-Based Curriculum in Ghana
 
Learner Digital Skills Toolkit DRAFT.docx
Learner Digital Skills Toolkit DRAFT.docxLearner Digital Skills Toolkit DRAFT.docx
Learner Digital Skills Toolkit DRAFT.docx
 
Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)
 

C++ Please I am posting the fifth time and hoping to get th.pdf

  • 1. C++ "Please I am posting the fifth time and hoping to get this resolved. I want the year to change from 2014 to 2015 but the days of the month change to 32 rather than 1/1/2015. Also, Please I want personal information in the heading as well Name: Last: and Course Name:" Modify the Time class(attached) to be able to work with Date class. The Time object should always remain in a consistent state. Modify the Date class(attached) to include a Time class object as a composition, a tick member function that increments the time stored in a Date object by one second, and increaseADay function to increase day, month and year when it is proper. Please use CISP400V10A4.cpp that tests the tick member function in a loop that prints the time in standard format during iteration of the loop to illustrate that the tick member function works correctly. Be aware that we are testing the following cases: a) Incrementing into the next minute. b) Incrementing into the next hour. c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM). d) Incrementing into the next month and next year. Time class The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)), minute (0 59), and second (0 59). It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute, getSecond,~Time, printUniversal, and printStandard public functions. 1. The Time function is a default constructor. It takes three integers and they all have 0 as default values. It also displays &quot;Time object constructor is called.&quot; message and calls printStandard and printUniversal functions. 2. The setTime function takes three integers but does not return any value. It initializes the private data members (hour, minute and second) data. 3. The setHour function takes one integer but doesnt return anything. It validates and stores the integer to the hour private data member. 4. The setMinute function takes one integer but doesnt return anything. It validates and stores the integer to the minute private data member. 5. The setSecond function takes one integer but doesnt return anything. It validates and stores the integer to the second private data member. Page 3 of 11 CISP400V10A4 6. The getHour constant function returns one integer but doesnt take anything. It returns the private data member hours data. 7. The getMinute constant function returns one integer but doesnt take anything. It returns the
  • 2. private data member minutes data. 8. The getSecond constant function returns one integer but doesnt take anything. It returns the private data member seconds data. 9. The Time destructor does not take anything. It displays &quot;Time object destructor is called.&quot; message and calls printStandard and printUniversal functions. 10. The printUniversal constant function does not return or accept anything. It displays time in universal-time format. 11. The printStandard constant function does not return or accept anything. It displays time in standard-time format. Date class The Date class has three private integer data members (month, day and year), one private Time object (time) data member and one static constant integer variable (monthsPerYear). It has Date, print, increaseADay, tick, and ~Date public functions. It has one private checkDay function. 1. The Date function is a default constructor. It takes 3 integers and one Time object. The three integers have default data (1, 2, and 1900) and the Time has (0, 0, and 0) as default data. It displays &quot;Date object constructor for date&quot; information when the constructor is called. 2. The print constant function does not take or return data. It prints out the month day year, hour, minute and second information. 3. The increaseADay function does not take or return data. It increases the private data member day by one. It also checks the day to make sure the data is accurate. If the data is not accurate it will adjust all the necessary corresponding data. 4. The tick function does not takes or return data. It increases one second to the Time object of the Date class private data member. This function has to make sure that the second increased is proper or it will adjust all the necessary corresponding data. 5. The ~Date function is a destructor of the Date class. It also displays &quot;Date object destructor is called &quot;; message and calls Time object destructor. 6. The constant checkDay function takes and returns an integer. It makes sure the accuracy of day, month, and year information. This utility function to confirm proper day value based on month and year, it also handles leap years, too. Page 4 of 11 CISP400V10A4 This assignment comes with a CISP400V10A4.zip file. It includes six files (CISP400V10A4.cpp, CISP400V10A4.exe, Date.cpp, Date.h, Time.cpp and Time.h). The CISP400V10A4.exe file is an executable file. You can double click the file to get to the expecting result (see the picture below) of this assignment. The Date.cpp, Date.h, Time.cpp, and Time.h are files that you can use so you dont need to start from scratch. After you finish your implementation for the Date and Time class, you
  • 3. can put the CISP400V10A4.cpp, Date.cpp, Date.h, Time.cpp, and Time.h in a project and then you can run to the same result as the CISP400V10A4.exe. Please be awarded that you can adjust only your program (Date.cpp, Date.h, Time.cpp and Time.h) to generate the required result but not the code in CISP400V10A4.cpp file. The following are the couple displays of the expecting results. // Date.h // Date class definition; Member functions defined in Date.cpp #ifndef DATE_H #define DATE_H class Date { public: static const unsigned int monthsPerYear = 12; // months in a year explicit Date( int = 1, int = 1, int = 1900 ); // default constructor void print() const; // print date in month/day/year format ~Date(); // provided to confirm destruction order private: unsigned int month; // 1-12 (January-December) unsigned int day; // 1-31 based on month unsigned int year; // any year // utility function to check if day is proper for month and year unsigned int checkDay( int ) const; }; // end class Date #endif // Time.h // Time class containing a constructor with default arguments. // Member functions defined in Time.cpp. // prevent multiple inclusions of header #ifndef TIME_H #define TIME_H // Time class definition class Time { public: explicit Time( int = 0, int = 0, int = 0 ); // default constructor // set functions void setTime( int, int, int ); // set hour, minute, second void setHour( int ); // set hour (after validation) void setMinute( int ); // set minute (after validation)
  • 4. void setSecond( int ); // set second (after validation) // get functions unsigned int getHour() const; // return hour unsigned int getMinute() const; // return minute unsigned int getSecond() const; // return second void printUniversal() const; // output time in universal-time format void printStandard() const; // output time in standard-time format private: unsigned int hour; // 0 - 23 (24-hour clock format) unsigned int minute; // 0 - 59 unsigned int second; // 0 - 59 }; // end class Time #endif // CISP400V10A4.cpp #include <iostream> using std::cout; using std::endl; #include "Time.h" // include Time class definition #include "Date.h" // include Date class definition const int MAX_TICKS = 30000; int main() { Time t(23, 59, 58);// create a time object Date d(12, 31, 2017, t); // create date object // output Time object t's values for ( int ticks = 1; ticks < MAX_TICKS; ++ticks ) { d.print(); // invokes print cout << endl; d.tick(); // invokes function tick } // end for d.~Date();// call Date destructor system("PAUSE"); return 0; } // end main // Date.cpp // Date class member-function definitions. #include <array> #include <iostream> #include <stdexcept> #include "Date.h" // include Date class definition using namespace std;
  • 5. // constructor confirms proper value for month; calls // utility function checkDay to confirm proper value for day Date::Date( int mn, int dy, int yr ) { if ( mn > 0 && mn <= monthsPerYear ) // validate the month month = mn; else throw invalid_argument( "month must be 1-12" ); year = yr; // could validate yr day = checkDay( dy ); // validate the day // output Date object to show when its constructor is called cout << "Date object constructor for date "; print(); cout << endl; } // end Date constructor // print Date object in form month/day/year void Date::print() const { cout << month << '/' << day << '/' << year; } // end function print // output Date object to show when its destructor is called Date::~Date() { cout << "Date object destructor for date "; print(); cout << endl; } // end ~Date destructor // utility function to confirm proper day value based on // month and year; handles leap years, too unsigned int Date::checkDay( int testDay ) const { static const array< int, monthsPerYear + 1 > daysPerMonth = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; // determine whether testDay is valid for specified month if ( testDay > 0 && testDay <= daysPerMonth[ month ] ) return testDay; // February 29 check for leap year if ( month == 2 && testDay == 29 && ( year % 400 == 0 || ( year % 4 == 0 && year % 100 != 0 ) ) ) return testDay; throw invalid_argument( "Invalid day for current month and year" ); } // end function checkDay
  • 6. // Time.cpp // Member-function definitions for class Time. #include <iostream> #include <iomanip> #include <stdexcept> #include "Time.h" // include definition of class Time from Time.h using namespace std; // Time constructor initializes each data member Time::Time( int hour, int minute, int second ) { setTime( hour, minute, second ); // validate and set time } // end Time constructor // set new Time value using universal time void Time::setTime( int h, int m, int s ) { setHour( h ); // set private field hour setMinute( m ); // set private field minute setSecond( s ); // set private field second } // end function setTime // set hour value void Time::setHour( int h ) { if ( h >= 0 && h < 24 ) hour = h; else throw invalid_argument( "hour must be 0-23" ); } // end function setHour // set minute value void Time::setMinute( int m ) { if ( m >= 0 && m < 60 ) minute = m; else throw invalid_argument( "minute must be 0-59" ); } // end function setMinute // set second value void Time::setSecond( int s ) { if ( s >= 0 && s < 60 ) second = s; else throw invalid_argument( "second must be 0-59" );
  • 7. } // end function setSecond // return hour value unsigned int Time::getHour() const { return hour; } // end function getHour // return minute value unsigned int Time::getMinute() const { return minute; } // end function getMinute // return second value unsigned int Time::getSecond() const { return second; } // end function getSecond // print Time in universal-time format (HH:MM:SS) void Time::printUniversal() const { cout << setfill( '0' ) << setw( 2 ) << getHour() << ":" << setw( 2 ) << getMinute() << ":" << setw( 2 ) << getSecond(); } // end function printUniversal // print Time in standard-time format (HH:MM:SS AM or PM) void Time::printStandard() const { cout << ( ( getHour() == 0 || getHour() == 12 ) ? 12 : getHour() % 12 ) << ":" << setfill( '0' ) << setw( 2 ) << getMinute() << ":" << setw( 2 ) << getSecond() << ( hour < 12 ? " AM" : " PM" ); } // end function printStandard