-
Notifications
You must be signed in to change notification settings - Fork 0
/
Time.h
37 lines (33 loc) · 916 Bytes
/
Time.h
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
/**
* Time.h
* Declaration of the Time class.
*
* Defines the Time class to handle time data in a 12-hour format. Includes functionality
* to set, print, and compare times, which is essential for applications that manage
* schedules or events based on time comparisons.
*
* Justin Harris
* 2024-04-29
* COSC 350 - Advanced Algorithms and Data Structures
* Programming Assignment 1
* Columbia College of Missouri
*/
#ifndef TIME_H
#define TIME_H
#include <string>
// Definition of the Time class
class Time {
public:
// Constructor with parameters for hour, minute, and AM/PM
Time(int hour, int minute, std::string amPm);
// Method to print time
void print() const;
// Method to compare two times
std::string comparedTo(const Time& other) const;
private:
// Private attributes for time details
int hour;
int minute;
std::string amPm; // "AM" or "PM"
};
#endif