-
Notifications
You must be signed in to change notification settings - Fork 0
/
Truck.cpp
50 lines (31 loc) · 917 Bytes
/
Truck.cpp
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
#include "Truck.h"
#include <iostream>
//Truck class constructors
Truck::Truck(){}
Truck::Truck(string truckOwner, string truckMake, string truckModel,
int truckYear, double truckCargoSpace, double truckCargoWeight) {
owner = truckOwner;
make = truckMake;
model = truckModel;
year = truckYear;
cargoSpace = truckCargoSpace;
cargoWeight = truckCargoWeight;
}
//Truck class setters/getters
void Truck::setcargoSpace(double truckCargoSpace) {
cargoSpace = truckCargoSpace;
}
double Truck::getcargoSpace() {
return cargoSpace;
}
void Truck::setcargoWeight(double truckCargoWeight) {
cargoWeight = truckCargoWeight;
}
double Truck::getcargoWeight() {
return cargoWeight;
}
//Functions
void Truck::getInfo(){
cout << owner << ": " << make << ", " << model << ", " << year
<< ", " << cargoSpace << " sqft, " << cargoWeight << " lbs" << endl;
}