-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReading.cpp
More file actions
30 lines (24 loc) · 809 Bytes
/
Reading.cpp
File metadata and controls
30 lines (24 loc) · 809 Bytes
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
#include "Reading.h"
// Purpose: Constructor if recieves no reading initalizes with values outside the bounds for later calculations
Reading::Reading() {
// if no input is used the reading will default to -1 which in this case signifies no reading in that array slot
meterRead = 0.0;
hour = -1;
}
// Purpose: Constructor takes in the time and meter reading and stores them together for later reference in specific customer type pricing plans
Reading::Reading(int time, float kWh) {
meterRead = kWh;
hour = time;
}
// Default destructor
Reading::~Reading() {}
//Accessor methods
float Reading::getMeterRead() { return meterRead; }
int Reading::getHour() { return hour; }
//mutator methods
void Reading::setMeterRead(float kWh) {
meterRead = kWh;
}
void Reading::setHour(int time) {
hour = time;
}