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 02:00
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
Match the file formats with the types of multimedia they can store
Answers: 2
question
Computers and Technology, 24.06.2019 01:30
How can you make your column headings stand out?
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, 03.02.2020 19:05
question
Mathematics, 03.02.2020 19:05
question
Biology, 03.02.2020 19:43
Questions on the website: 13722360