subject

Write a class named gastank containing:
an instance variable named amount of type double, initialized to 0.
a method named addgas that accepts a parameter of type double.
the value of the amount instance variable is increased by the value of the parameter.
a method named usegas that accepts a parameter of type double.
the value of the amount instance variable is decreased by the value of the parameter.
a method named getgaslevel that accepts no parameters.
getgaslevel returns the value of the amount instance variable.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, willwhitlock803
Write code using c . (take input from user) calculate the size of a given file in kbs. in this task you will complete the function with the following prototype: float get_file_size(char * filename); the function takes the file name (address to the start of a null terminated character array) as input. the function should then open the file and find the number of bytes it contains till eof. the number of bytes divided by 1024 will give the size in kbs. if the file cannot be opened the function should return -1.
Answers: 2
image
Computers and Technology, 22.06.2019 17:30, cesargarcia17671
Type the correct answer in the box. spell all words correctly. under which key category do the page up and page down keys fall? page up and page down keys fall under the keys category.
Answers: 3
image
Computers and Technology, 22.06.2019 21:30, GamerGirl15
This graph compares the total cost of attending educational institutions in texas. the graph demonstrates that the cost at private and public technical schools greatly varies.
Answers: 2
image
Computers and Technology, 23.06.2019 02:30, bre563
Research data that is presented using descriptive language is said to be
Answers: 2
You know the right answer?
Write a class named gastank containing:
an instance variable named amount of type double, in...

Questions in other subjects:

Konu
Mathematics, 12.01.2021 18:20
Konu
Mathematics, 12.01.2021 18:20