subject

The van class, given below, is used by a small shuttle service that transports passengers around new england. the attributes for this class are: a van's id; a van's capacity - the number of passengers it can carry, a van's driver, and a van's range - how many miles it can go in a single trip. a van's range can be variable: extra gas tanks are sometimes available, which extend a van's range, but sometimes single trip travel is limited by state law. public class van{ private string id; private int capacity; // how many passengers does van hold? private string driver; // who's driving? private int range; // miles traveled on one tank of gas public van(string id, int cap, string d, int r){ this. id = id; capacity = cap; driver = d; range = r; } public string getid(){ return id; } public int getcapacity(){ return capacity; } public string getdriver(){ return driver; } public int getrange(){ return range; } public void setdriver(string newguy){ driver = newguy; }}in the box below, enter the code for a new public method called changerange, which is to be added to the van class definition. it should take one parameter, a double value. if somevan is a van in the company fleet, thensomevan. changerange(.2); should change the range of the van by .2, or 20%. if the initial range of somevan was 300 miles, its new range should now be 20% higher, or 360 miles. on the other hand, this statement: somevan.); should reduce the range by 10%. thus, if the initial range of somevan was 300 miles, its new range should now be 10% lower, or 270 miles. enter the complete code for this method in the box below.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Aplan to budget time for studying and activities is referred to as a study routine. study habits. study skills. a study schedule.
Answers: 1
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
To maintain clarity and focus lighting might be needed
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
You know the right answer?
The van class, given below, is used by a small shuttle service that transports passengers around new...
Questions
question
Mathematics, 11.10.2019 22:30
question
Mathematics, 11.10.2019 22:30
question
Advanced Placement (AP), 11.10.2019 22:30
Questions on the website: 13722367