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

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
Describe in pseudocode an algorithm that given an integer n and a linked list of elements increases the linked list by a factor of n by replacing each element in the original list with n copies of that element. for example, if l: [18, 7, 4, 24, 11] and n = 3 the resulting list should be l: [18, 18, 18, 7, 7, 7, 4, 4, 4, 24, 24, 24, 11, 11, 11]. if the value of n is less than or equal to 0, the list should be empty after the call. what’s the running time of your algorithm?
Answers: 3
question
Computers and Technology, 22.06.2019 06:00
Pthe price of tickets in a group when a purchased in bulk can be found with the equation c=px+24 were c is the cost, p is the number of people,and x is the price per ticket. what is price of of each ticket if it costs $189 to buy tickets for 15 people ? a $8 b $24c $9d $11 show work
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
You know the right answer?
Write a class named gastank containing:
an instance variable named amount of type double, in...
Questions
question
Mathematics, 09.12.2020 02:40
question
Mathematics, 09.12.2020 02:40
question
Computers and Technology, 09.12.2020 02:40
question
Mathematics, 09.12.2020 02:40
Questions on the website: 13722363