Write a full definition for a class named GasTank, and containing the following
ID: 3658741 • Letter: W
Question
Write a full definition for a class named GasTank, and containing the following members: A data member named amount of type double. A constructor that no parameters. The Constructor initializes the data meber amount to 0. A function named addGas that accepts a parameter of type double. The value of the amount instance variable is increased by the value of the parameter. A function named useGas that accepts a parameter of type double. The value of the amount data meber is decreased by the value of the parameter.Explanation / Answer
class GasTank { private: double amount; public: GasTank(); void addGas(double); void useGas(double); double getGasLevel();
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.