Question: Can someone get me the Java code for this program to work in Eclipse I've tried all the travel app documents and it doesn't work:

Can someone get me the Java code for this program to work in Eclipse I've tried all the travel app documents and it doesn't work:

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.

Step by Step Solution

3.35 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution Here is the Java code for the TravelApp program public class TravelApp public static void m... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!