Descripton: I would like you to create two new classes”YourCar” and “YourCarTrip” that will help you calculate the totaldistance from one point (point A) to a second point (point B), howlong it will take you to get there, and if you need gas for thereturn trip. YourCarTrip is the application.

Example: Depart UHCL (point A), take a left on to BayArea Boulevard for 3.5 miles at 30 MPH, take a left onto I45 Southfor 26.3 miles at 65 MPH, exit right onto 61st street, go 2.0 milesto Stewart Drive, take a right and go 4.3 miles at 45 MPH to yourdestination on the right (point B).

YourCar should define, at least, the instancevariables that hold the number of gallons in the tank (must beinput at some point), the number of miles in the trip (starts atzero), current speed (starts at zero). YourCar should also be ableto change direction, change speed (increase, decrease), anddetermine if you need gas. Needs gas, implies you will need tocalculate your fuel consumption, so assume your car averages 25 MPGat any speed.

I would like you to run two different YourCar objectsat the same time to see if it is worth the time to go ten milesover the speed limit. so, your application should output, the route(changes in course), the total distance, the total time, and fuelconsumption.

Hint: you can assume you know the followinginformation. 1) the number of road segment 2) for each roadsegment, you have information of speed limit, length of the roadsegment, direction that the car is heading, the name of theroad.

***********************************************************************************************************************************************************************************************************

Description: I would like you to update the classesyou created for homework3. Update “YourCar” and “YourCarTrip” suchthat you use a “for” loop to enter each leg. Your applicationshould ask the user for the number of legs for the trip, thensubsequently ask for the distance and the speed limit for each legof the trip. The input values for speed and distance will help youcalculate the time required for each leg of the trip and totaldistance and total time for the trip. Additionally, make sure youhave enough gas to make the return trip by calculating the amountof fuel needed for the return trip (please assume the same route inreturn). The programmer must use a ‘for’ loop to implement thisapplication. Outputs should include, but are not limited to: timeto travel each leg, total time, total distance, fuel consumptionand remaining fuel.

Example: Depart UHCL (point A), take Bay AreaBoulevard for 3.5 miles at 30 MPH, take I45 South for 26.3 miles at65 MPH, exit right onto 61st street and go 2.0 miles at 30 MPH,then take Stewart Drive 4.3 miles at 45 MPH to your destination(point B). You application should ask the user for the number oflegs (this case four (4)) then loop through four sets of questionsto gather the necessary inputs for distance and speed.

YourCar should define, at least, the instancevariables that hold the number of gallons in the tank (must beinput at some point), the number of miles in the trip (starts atzero), current speed (starts at zero). YourCar should have theability (methods) to change speed (increase, decrease), calculatetime, calculate distance traveled, and determine if you need gas.Needs gas, implies you will need to calculate your fuelconsumption, so assume your car averages 25 MPG at any speed. Youmay have to ask the user for amount of fuel (gallons) at thebeginning of the trip. Constraint: Your gas tank cannot hold over10 gallons.

******* Need code for the 2nd portion, the updateportion*********

******Please code in Java******