subject

Write the implementation (cpp file) of the GasTank class of the
previous exercise. The full specification of the class is:.
1. A data member named amount of type double.
2. An data member named capacity of type double.
3. A constructor that accepts a parameter of type double. The value
of the parameter is used to initialize the value of capacity. The
constructor also sets amount to zero.
4. A function named add Gas that accepts a parameter of type double.
The value of the amount instance variable is increased by the value of
the parameter. However, if the value of amount is increased beyond
the value of capacity, amount is set to capacity.
5. A function named use Gas that accepts a parameter of type double.
The value of the amount data member is decreased by the value of
the parameter. However, if the value of amount is decreased below 0,
amount is set to 0.
6. A function named is Empty that accepts no parameters and returns a
boolean value. is Empty returns true if the value of amount is less than
0.1, and false otherwise.
7. A function named is Full that accepts no parameters and returns a
boolean value.. is Full returns true if the value of amount is greater
than capacity-0.1, and false otherwise.
8. A function named get Gas Level that accepts no parameters.
Get Gas Level returns the value of the amount data member.
9. A function named fillUp that accepts no parameters and returns
a double. fillUp increases amount to capacity and returns the
difference between the value of capacity and the original value
of amount (that is, the amount of gas that is needed to fill the tank to
capacity).

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:10
Ac++an of of pi. in , pi is by : pi = 4 – 4/3 + 4/5 – 4/7 + 4/9 - 4/11 + 4/13 - 4/15 + 4/17 . ., to pi (9 ). , if 5 to pi,be as : pi = 4 - 4/3 + 4/5 - 4/7 + 4/9 = 4 – 1. + 0.8 - 0. + 0. = 3.. atoofbe to pi?
Answers: 2
question
Computers and Technology, 23.06.2019 18:40
Johnson enterprises uses a computer to handle its sales invoices. lately, business has been so good that it takes an extra 3 hours per night, plus every third saturday, to keep up with the volume of sales invoices. management is considering updating its computer with a faster model that would eliminate all of the overtime processing.
Answers: 2
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
question
Computers and Technology, 24.06.2019 02:40
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
You know the right answer?
Write the implementation (cpp file) of the GasTank class of the
previous exercise. The full s...
Questions
question
Mathematics, 16.09.2019 06:10
question
English, 16.09.2019 06:10
question
Mathematics, 16.09.2019 06:10
question
Mathematics, 16.09.2019 06:10
Questions on the website: 13722363