-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVehicle.cpp
41 lines (33 loc) · 836 Bytes
/
Vehicle.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
41
// Kelton ___
// ________
// November 26, 2024
#include <iostream>
#include <string>
#include "Vehicle.h"
using namespace std;
Vehicle::Vehicle() { // default constructor
manufacturer = "Undefined Manufacturer";
buildYear = 0;
}
Vehicle::Vehicle(string sManufacturer, int iBuildYear) { // constructor
manufacturer = sManufacturer;
buildYear = iBuildYear;
}
// getters
string Vehicle::getManufacturer() const {
return manufacturer;
}
int Vehicle::getBuildYear() const {
return buildYear;
}
// setters
void Vehicle::setManufacturer(string sManufacturer) {
manufacturer = sManufacturer;
}
void Vehicle::setBuildYear(int iBuildYear) {
buildYear = iBuildYear;
}
void Vehicle::displayInfo() const {
cout << "Manufacturer: " << manufacturer << endl
<< "Year Built: " << buildYear << endl;
}