Need help on this not for sure what I am missing I get a couple of errors!In included both the .h and .cpp information.
// Make sure the header file it not added more than once
#pragma once
#ifndef MYTIME_H
#define MYTIME_H
#include <iostream>
using std::ostream;
using std::istream
class MyTime
{
private:
// day 1
int day;
// hours 0-23
int hour;
// minutes 0-59
int min;
// seconds 0-59
int sec;
public:
// Default
MyTime ()
// copy
MyTime(const MyTime & origMyTime)
// pram
MyTime(int day, int hour, int min, int sec)
// destructor
~MyTime()
// access
// day, hour, min, sec
int SetDay()
int SetHour()
int SetMinute()
int SetSecond()
// get functions
// day, hour, min, sec
int GetDay() const
int GetHour()const
int GetMinute()const
int GetSeconds()const
// print functions
void setDay()
void setHour()
void setMinute()
void setSecond()
// add
void IncrDay(int addDay)
void IncrHour(int addHour)
void IncrMinute(int addMinute)
void IncrSecond(int addSecond)
// subtract
void DecDay(int subtractDay)
void DecHour(int subtractHour)
void DecMinute(int subtractMinute)
void DecSecond(int subtractSecond)
// <<, >> insertion and extraction
friend ostream & operator<< (ostream & os, const MyTime & aMyTime ) // Output
friend istream & operator>> (istream & is, const MyTime & aMyTime ) // Input
//(boolean test operators)
bool operator==(const MyTime & aMyTime) // Compare ==
bool operator!=(const MyTime & aMyTime) // Compare !=
bool operator< (const MyTime & aMyTime) // Compare <
bool operator<=(const MyTime & aMyTime) // Compare <=
bool operator> (const MyTime & aMyTime) // Compare >
bool operator>=(const MyTime & aMyTime) // Compare >=
}#endif
//MyTime.cpp
#include "MyTime.h" // time class definition
#include <ctime>
using std::ostream
MyTime::MyTime()
// day 1
int day = 0;
// hours 0-23
int hour = 0;
// minutes 0-59
int min = 0;
// seconds 0-59
int sec = 0;
MyTime::MyTime(const MyTime &origMyTime)
MyTime::~MyTime()
MyTime::SetDay()
MyTime::SetHour()
MyTime::SetMinute()
MyTime::SetSecond()
// Methods
int MyTime::GetDay()
int MyTime::GetHour()
int MyTime::GetMinute()
int MyTime::GetSecond()
// print
void MyTime::setDay
void MyTime::setHour
void MyTime::setMinute
void MyTime::setSecond
// add time
void MyTime::IncrDay
void MyTime::IncrHour
void MyTime::IncrMinute
void MyTime::IncrSecond
// subtract time
void MyTime::DecDay
void MyTime::DecHour
void MyTime::DecMinute
void MyTime::DecSecond
bool MyTime::Equals(const MyTime & aMyTime) const
ostream & operator<< (ostream & os, const MyTime & aMyTime)
istream & operator>> (istream & is, MyTime & aMyTime)
// >, <, >=, <=, ==, != (boolean relational test operators)
bool MyTime::operator> (const MyTime & aMyTime) const
if (this->Compare(aMyTime) > 0)
return true;
else
return false;
bool MyTime::operator< (const MyTime & aMyTime) const
if (this->Compare(aMyTime) < 0)
return true;
else
return false;
bool MyTime::operator>= (const MyTime & aMyTime) const
if (this->Compare(aMyTime) >= 0)
return true;
else
return false;
bool MyTime::operator<= (const MyTime & aMyTime) const
if (this->Compare(aMyTime) <= 0)
return true;
else
return false;
bool MyTime::operator== (const MyTime & aMyTime) const
if (this->Equals(aMyTime) == true)
return true;
else
return false;
bool MyTime::operator!= (const MyTime & aMyTime) const
if (this->Equals(aMyTime) == false)
return true;
else
return false;
return is;
}