-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClock.cpp
executable file
·42 lines (33 loc) · 1.28 KB
/
Clock.cpp
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
/* File: Clock.cpp
* Programmer: Steven Heid
* Course: COP 2931
*
* Purpose:
* Write a class for time objects that store three integer values for hour, minute, and second.
* Also, write a program to test the functionality of your class. Make sure it does all of the following:
*
* -Create time objects with no values (default)
* -Create time objects with all three values (hour, minute, second)
* -Change the value for hour
* -Display military time
* -Display standard time
*/
#include <iostream>
#include <iomanip>
#include "Time.h"
using namespace std;
int main()
{
Time defaultTime; // creates class-'Time' called 'defaultTime'
Time inputTime(0, 0, 0); // creates class-'Time' called 'inputTime' with 3 variables
inputTime.setHour(18); // 'inputTime' > 'setHour' assigned value of 18
defaultTime.printMilitary(); // 'defaultTime' constructor function call to output military time
cout << endl;
defaultTime.printStandard(); // 'defaultTime' constructor function call to output standard time
cout << endl;
inputTime.printMilitary(); // 'inputTime' constructor function call to output military time
cout << endl;
inputTime.printStandard(); // 'inputTime' constructor function call to output standard time
cout << endl;
system("pause");
}