Write the interface (.h file) of a class GasTank containing: An data member name
ID: 3660495 • Letter: W
Question
Write the interface (.h file) of a class GasTank containing: An data member named amount of type double. An data member named capacity of type double. A constructor that accepts a parameters of type double. A function named addGas that accepts a parameter of type double and returns no value. A function named useGas that accepts a parameter of type double and returns no value. A function named isEmpty that accepts no parameters and returns a boolean value. A function named isFull that accepts no parameters and returns a boolean value. A function named getGasLevel that accepts no parameters and returns double.Explanation / Answer
class GasTank { private: double amount; public: GasTank(); void addGas(double); void useGas(double); double getGasLevel(); };
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.