// Filename: TimeObject.cpp
// Author: G. Safko  <greg.safko@gmail.com>
// CS&P Lab Lecture
// Description: Objects, and OOP
// Date Written: March 21, 2005
// Last Changed: March 21, 2005
 

#include <iostream>
#include <cstdlib>
using namespace std;

class time
{
private:

	int hour;
	int minute;
	int second;
	bool AM;

	// the facilitators (usually private)
	void checkValidHour(void); 	
 	void checkValidMinute(void); 	
	void checkValidSecond(void);

public:
	// the constructors
	time( );  // constructors do not have a return type
	time(int h, int m, int s);

	// the accessors
	int getHour(void); 	
	int getMinute(void);
	int getSecond(void);
	bool isAM(void);
	bool isPM(void);
	void printStandard(void);
	void printMilitary(void);

	// the mutators
	void setHour(int); 	
	void setMinute(int); 
	void setSecond(int); 	
	void setAM(void); 	
	void setPM(void); 

};


int main()
{
	time midnight();
	time lunch(11, 59, 59);   
	

    return EXIT_SUCCESS;
}


// the functionality for the time class methods
// usually (but not always) written outside of the class definition
// need to use the class name and the scope operator, in this case:
// time::<method>


// the constructors
time::time( )  // constructors do not have a return type
{
	minute = second = 0;
	hour = 12;
	AM = true;
}

time::time(int h, int m, int s)
{
	hour = h;
	minute = m;
	second = s;
	AM = true;
}


