Using python.
Create a class which should include three public data members: int speed, int gas, bool on and seven public functions. The function Car() is a constructor, turnOn( ) turns the Car on, turnOff( ) turns the Car off, setSpeed(int newSpeed) sets a new speed for this Car, setGas(int newGas) sets a new gas level for this Car, speedUp( ) increases the Car speed number by 5 mph, speedDown( ) decreases the Car speed number by 5 mph.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here