Question : c++ convert Military time to Standard Time

i made this class that should convert military time to standard to time. but i have a flaw somewhere in the code , that is outputting incorrectly.

i initial it at  2401.  

output i get :  12:01 pm.  

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
class Time
{
 private:
 
    int hour;
    int minute;
 public:
	Time (int =24, int = 01);
    
	~Time();
	
	void setTime(int,int);
	void setHour(int);
	void setMinute(int);
	int getHour();
	int getMinute();
	int printTime();
};

Time::Time(int hour,int minute)
{
 setTime(hour,minute);
}

void Time::setTime(int hour, int minute)
{
 setHour(hour);
 setMinute(minute);
}

void Time::setHour( int h)
{
 if(h<=12)
 {
   hour = h-12;
 }
 if(h>12 && h<=24)
 {
   hour = h-12;
 }
}
void Time::setMinute(int m)
{
 minute = m;
}

int Time::getHour();
{
 return hour;
}

int Time::getMinute()
{
 return minute;
}

void Time::printTime()
{
 if(hour <= 12 && hour >= 24)
 {
  cout<<hour<<":"<<minute<<" am"<<endl;
 }
 if(hour >= 12 && hour <= 24)
 {
  cout<<hour<<":"<<minute<<" pm"<<endl;
 }
}

Answer : c++ convert Military time to Standard Time

The last minute of a day is 23:59, the next minute of the next day is 00:00, midnight, in military/24 hour time.  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
void Time::setHour( int h)
{
 if(h<=24)
 {
   hour = h % 12;
   if(hour == h) daypart = "am";
   else daypart = "pm";
 }
 else "error"....
}
Random Solutions  
 
programming4us programming4us