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, 22.06.2019 06:30
Requirement types discussed during software development include functional and color scheme nonfunctional and code style constraint and nonfunctional fashionable and functional.
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 23.06.2019 12:30
What is the difference between the internet and the world wide web?
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
Physics, 31.03.2021 21:10
Questions on the website: 13722361