class ParkingSystem {
public int bigAccount = 0,mediumAccount = 0,smallAccount = 0;
public int bigPark = 0,mediumPark = 0,smallPark = 0;
public ParkingSystem(int big, int medium, int small) {
bigPark = big;
mediumPark = medium;
smallPark = small;
}
public boolean addCar(int carType) {
if(carType == 1){
if(bigPark > bigAccount) {
bigAccount++;
return true;
}
else return false;
}
if(carType == 2){
if(mediumPark > mediumAccount) {
mediumAccount++;
return true;
}
else return false;
}
if (carType == 3){
if(smallPark > smallAccount) {
smallAccount++;
return true;
}
else return false;
}
else return false;
}
}
/**
* Your ParkingSystem object will be instantiated and called as such:
* ParkingSystem obj = new ParkingSystem(big, medium, small);
* boolean param_1 = obj.addCar(carType);
*/