-
Notifications
You must be signed in to change notification settings - Fork 0
/
customer.h
45 lines (39 loc) · 1.16 KB
/
customer.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
38
39
40
41
42
43
44
45
// <Put your name and date here>
// FILE: customer.h
// CLASS PROVIDED: customer
// A customer has the following features:
// id: a positive integer identification number
// arrival_time: a real value showing the arrival time
// departure_time: a real value showing the departure time
//
#ifndef CUSTOMER_H
#define CUSTOMER_H
#include <iostream>
using namespace std;
class customer{
private:
unsigned int id;
double arrival_time;
double departure_time;
public:
//constructors
customer() {}
customer(unsigned int i) { id = i; }
customer(unsigned int i, double t1, double t2)
{
id = i;
arrival_time = t1;
departure_time = t2;
}
// MODIFICATION MEMBER FUNCTIONS
void set_id(unsigned int i) {id = i; }
void set_arrival(double t) { arrival_time = t; }
void set_departure(double t) { departure_time = t; }
// CONSTANT MEMBER FUNCTIONS
unsigned int get_id() const { return id; }
double get_arrival() const { return arrival_time; }
double get_departure() const { return departure_time; }
void print_info() const { cout << "C" << id; }
double get_wait_time() const { return departure_time - arrival_time; }
};
#endif