forked from CEN4020-Fall/assignment2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJetski.cpp
More file actions
39 lines (32 loc) · 970 Bytes
/
Copy pathJetski.cpp
File metadata and controls
39 lines (32 loc) · 970 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
35
36
37
38
39
//Created by Logan Leone
#include "Jetski.h"
Jetski::Jetski(string brand, string model, string fuelType, string hullMat){
setBrand(brand);
setModel(model);
setFuelType(fuelType);
setHullMaterial(hullMat);
}
Jetski::~Jetski() = default;
string Jetski::getHullMaterial(){
return hullMaterial;
}
void Jetski::setHullMaterial(string hullMat){
if (hullMat == "plastic" || hullMat == "reinforced carbon fiber"){
hullMaterial = hullMat;
}else{
hullMaterial = "unknown";
}
}
double Jetski::mileageEstimate(double time){
//The mileage of a jetski comes from 10 * the time, but if the time is greater than 50,
//then the mileage is the mileage plus 2% of the time.
double mileage = 10 * time;
if (time > 50){
mileage += .025 * time;
}
return mileage;
}
string Jetski::toString(){
return "-> Jetski\n" + PoweredVehicle::toString() + "\n\tHull Material: " +
getHullMaterial();
}