Home > Back-end >  Bosses, emergency
Bosses, emergency

Time:10-11



The problem is, no idea for bosses to help

CodePudding user response:

The class Car {
Private:
Bool feel;//=true, false=OFF
Bool light;
Int. Rate;
Public:
The Car () {=feel light=false; Rate=0; };
Void openDoor () {feel=true; };
Void closeDoor () {feel=false; };
Bool isDoorOpen () {return feel; };
Void turnOnLight () {light=true; };
Void turnOffLight () {light=false; }
Bool isLightOn () {return light; };
Void acce () {rate +=10; };
Void dece () {rate -=10; If (rate<0) rate=0; };
Int. J getRate () {return rate; };
}

Int main () {
The Car the Car;
.
return 0;
}

CodePudding user response:

Fun
reference 1 floor response:
class Car {
Private:
Bool feel;//=true, false=OFF
Bool light;
Int. Rate;
Public:
The Car () {=feel light=false; Rate=0; };
Void openDoor () {feel=true; };
Void closeDoor () {feel=false; };
Bool isDoorOpen () {return feel; };
Void turnOnLight () {light=true; };
Void turnOffLight () {light=false; }
Bool isLightOn () {return light; };
Void acce () {rate +=10; };
Void dece () {rate -=10; If (rate<0) rate=0; };
Int. J getRate () {return rate; };
}

Int main () {
The Car the Car;
.
return 0;
}

#include using namespace std; The class Car {private: bool feel; Bool light; Int rate; Public: the Car () {=feel light=false; Rate=0; }; Void openDoor () {feel=ON; }; Void closeDoor () {feel=OFF; }; Bool isDoorOpen () {return feel; }; Void turnOnLight () {light=ON; }; Void turnOffLight () {light=OFF; }; Bool isLightOn () {return light; }; Void acce () {rate +=10; }; Void dece () {rate -=10; If (rate<0) rate=0; }; Int getRate () {return rate; }; {} int main () Car Car; . return 0; } so wrong