[ C++ ] [ Switch Case ]
Code\n\nclass ParkingSystem {\npublic:\n    int bigSpace;\n    int mediumSpace;\n    int smallSpace;\n    ParkingSystem(int big, int medium, int small) {\n     
# Code\n```\nclass ParkingSystem {\npublic:\n    int bigSpace;\n    int mediumSpace;\n    int smallSpace;\n    ParkingSystem(int big, int medium, int small) {\n        bigSpace=big;\n        mediumSpace=medium;\n        smallSpace=small;\n    }\n    \n    bool addCar(int carType) {\n        switch(carType){\n            case 1:{\n                    if(bigSpace==0)\n                        return false;\n                    else\n                        bigSpace--;\n                }\n                break;\n            case 2:{\n                    if(mediumSpace==0)\n                        return false;\n                    else\n                        mediumSpace--;\n                }\n                break;\n            case 3:{\n                    if(smallSpace==0)\n                        return false;\n                    else\n                        smallSpace--;\n                }\n                break;\n        }\n        return true;\n    }\n};\n\n/**\n * Your ParkingSystem object will be instantiated and called as such:\n * ParkingSystem* obj = new ParkingSystem(big, medium, small);\n * bool param_1 = obj->addCar(carType);\n */\n```
['C++']