Write the interface (.h file) of a class  GasTank containing: 
An data member named  amount of type double. 
A constructor that accepts no parameters. 
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  getGasLevel that accepts no parameters and returns double. 
Instructor's notes: Ignore the injected "(.h file)" from the instructions above. Create the Interface according chapter 6.2 in the textbook.
Note that you don't have to implement any of the functions.
Also, don't forget the semicolon at the end of the class definition.
How do i solve this on c ++?
Hey buddy....first of all you should attdedn all classes for this question just dont look at question and copy paste it in yahoo. It is not good way to learn c++...
any way 
here is answer:::
class GasTank
{
private:
double amount;
public:
GasTank();
void addGas(double);
void useGas(double);
double getGasLevel();
};
Subscribe to:
Post Comments (Atom)
 
No comments:
Post a Comment