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,...


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.



Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here