forked from CEN4020-Fall/assignment2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBicycle.cpp
More file actions
34 lines (26 loc) · 682 Bytes
/
Bicycle.cpp
File metadata and controls
34 lines (26 loc) · 682 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
31
32
33
34
//
// Created by Esteban Parra on 9/5/19.
//
#include "Bicycle.h"
Bicycle::Bicycle(string brand, string model, int gearCount) {
setBrand(brand);
setModel(model);
setGearCount(gearCount);
}
Bicycle::~Bicycle() = default;
int Bicycle::getGearCount() {
return myGearCount;
}
void Bicycle::setGearCount(int gearCount) {
myGearCount = gearCount;
}
double Bicycle::mileageEstimate(double time) {
double mileage = 3 * time;
mileage += mileage * (myGearCount * 0.1);
return mileage;
}
string Bicycle::toString() {
string s = "-> Bicycle\n\t";
return "-> Bicycle\n" + Vehicle::toString() + "\n\tGears: " +
to_string(myGearCount);
}