-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime.h
More file actions
69 lines (58 loc) · 1.68 KB
/
time.h
File metadata and controls
69 lines (58 loc) · 1.68 KB
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
68
69
/* James McAdams
* Project #2 - Overridden Operators
* Mathmatical Functions of Time
* CSC220 - Summer 2015
* 07/14/2015
*
* time.h
*
*/
#ifndef _TIME_
#define _TIME_
#include <iostream>
#include <string>
#include <cmath>
#include "numberbase.h"
using namespace std;
// ----------------------- Class - Begin -------------------------
class Time : public NumberBase
{
private:
int d, h, m, ip, ap, ht1, ht2;
int d1, h1, m1, ap1;
int d2, h2, m2, ap2;
int di, hi, mi, api, ipi;
int d_o, h_o, m_o, ap_o;
int d_d, h_d, m_d, ap_d;
char ap_c[3];
float mult;
public:
Time ();
Time (int d, int h, int m, int ap);
Time (int d, int h, int m, int ap, int ip);
Time (int d, int h, int m, int ap, float mult);
Time (int d1, int d2, int h1, int h2, int m1, int m2, int ap1, int ap2);
Time (int d1, int d2, int h1, int h2, int m1, int m2, int ap1, int ap2, int larger);
Time (const Time& base)/* : NumberBase ( )*/;
~Time();
// ----------------------- Getters/Setters - Begin ---------------
int get_d() const;
int get_h() const;
int get_m() const;
int get_ap() const;
void set_d(int di);
void set_h(int hi);
void set_m(int mi);
void set_ap(int api);
// ----------------------- Getters/Setters - End ----------------
// -------------- Operator Overloading - Begin --------------------
Time operator=(const Time &that);
Time operator+(const Time &that);
Time operator-(const Time &that);
Time operator*(const Time &that);
friend ostream& operator<<(ostream &strm, const Time &that);
// -------------- Operator Overloading - End ----------------------
void print();
void demo();
};
#endif