Question
Please do in JAVA : TripPlanner: Create all four fields. Then use the code generation from Eclipse to create the constructor and the toString method.
Please do in JAVA :
TripPlanner: Create all four fields. Then use the code generation from Eclipse to create the constructor and the toString method. Make the following change in class toString: Use only the model to represent the car, not the toString method of class Car. (see Expected Output below) In method fuelConsumption do the following: Calculate the amount of fuel that is required to travel from the departure to the destination and return the result in full precision (not rounded). Doc Comments: Add doc comments for all classes, constructors, and public methods. Follow the style guidelines that were discussed in the practice video. Car: Create the fields and use the code generation from Eclipse to create the constructor and the getters. Doc Comments: Add doc comments for all classes, constructors, and public methods. Follow the style guidelines that were discussed in the practice video. TravelApp: The class TravelApp is a test client and it includes the main method. Create two cars: m4: BMW M4 that uses 25 mpg civic: Honda Civic that uses 42 mpg Display the information of both cars in the following format: {make} {model} {mpg} mpg where {make}, {model}, and {mpg} are substituted by the values of the corresponding fields. Create two trips: California Trip: Drive from SF to LA, 382 miles, in your BMW M4 Florida Trip: Drive from Tampa to Miami, 280 miles, in your Honda Civic Display information about the planned trips. For each of the trips, print the following: A title so we know which trip we are describing The string that is returned by the toString method Information about fuel consumption in the following format: fuel consumption: {fuel consumption} gallons where {fuel consumption} is the fuel consumption of the whole trip, rounded to one digit after the decimal point. Format the output as shown in the Expected Output below. Pay attention to titles and single empty lines to group related output.
Expected Output
Cars:
BMW M4 25 mph
Honda Civic 42 mph
California Trip:
TravelPlanner [departure=SF, arrival=LA, distance=382, car=M4]
fuel consumption: 15.3 gallons
Florida Trip:
TravelPlanner [departure=Tampa, arrival=Miami, distance=280, car=Civic]
fuel consumption: 6.7 gallons
ents JAR X O LabGetting Started With Eclips x C Please Do In JAVA: Trip Planner X + assignments/7193176 TISTI UCITO en the Java project 1410_LABS and add a new package called docComments. de this new package, implement the following two classes as specified in the UML class diagr ed, removed, or changed. fore you start coding, please review the Style Guide. This and all code submissions in CSIS 141 Trip Planner - departure: String -parrival: String - Oistance : int + Trip Planner(departure : String, arrival : String, distance: int, Car: car) + fuelConsumption(): double + toString(): String Car - make : String - model: String - mpgint + Car ( make : String, model: String, mpg :int) + getMake(): String + getModell: String + getMpg : int Trip Planner: Create all four fields. Then use the code generation from Eclipse to create the constructor and the tos Make the following change in class toString: Use only the model to represent the car, not the toString method of class Car. (see Expected Output In method fuelConsumption do the following: Calculate the amount of fuel that is required to travel from the departure to the destination and retu Doc Comments: Add doc comments for all classes, constructors, and public methods. Follow the style guidelines that Car: Create the fields and use the code generation from Eclipse to create the constructor and the getters. . Doc CommentsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started