subject

Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called. write a constructor for the above class that initialized both variables to zero. write a tostring to display both the tank and speed when the car is printed. modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter. write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
To hide gridline when you display or print a worksheet
Answers: 1
question
Computers and Technology, 22.06.2019 11:50
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
question
Computers and Technology, 22.06.2019 12:40
The most complicated four letter word
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Aman travel 200m towards east< br /> from his house then takes left< br /> to turn and moves 200 m north< br /> find the displacement & distance.< br />
Answers: 3
You know the right answer?
Write a car class having two private member variables called tank and speed. write public methods ca...
Questions
question
Computers and Technology, 31.08.2021 23:50
Questions on the website: 13722359