SE-TP2/code/CarSpotController.cpp

31 lines
726 B
C++

class CarSpotCOntroller {
private:
int total_spots;
int occupied_spots;
public:
CarSpotCOntroller(int default_total_spots) {
this->set_total_spots(default_total_spots);
}
int get_total_spots() {
return this->total_spots;
}
void set_total_spots(int total_spots) {
this->total_spots = total_spots;
}
int get_occupied_spots() {
return this->occupied_spots;
}
void set_occupied_spots(int occupied_spots) {
this->occupied_spots = occupied_spots;
}
void increment_occupied_spots () {
this->occupied_spots++;
}
};