Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Problem4 (40 points): YourCar Problem. (Problem-solving process is required.) Descripton: I would like you to create two new classes YourCar and Your CarTrip that

java image text in transcribed
Problem4 (40 points): YourCar Problem. (Problem-solving process is required.) Descripton: I would like you to create two new classes "YourCar" and "Your CarTrip" that will help you calculate the total distance from one point (point A) to a second point (point B), how long it will take you to get there, and if you need gas for the return trip. YourCarTrip is the application. Example: Depart UHCL (point A), take a left on to Bay Area Boulevard for 3.5 miles at 30 MPH, take a left onto 145 South for 26.3 miles at 65 MPH, exit right onto 61st street, go 2.0 miles to Stewart Drive, take a right and go 4.3 miles at 45 MPH to your destination on the right (point B). Your Car should define, at least, the instance variables that hold the number of gallons in the tank (must be input at some point), the number of miles in the trip (starts at zero), current speed (starts at zero). YourCar should also be able to change direction, change speed (increase, decrease), and determine if you need gas. Needs gas, implies you will need to calculate your fuel consumption, so assume your car averages 25 MPG at any speed. I would like you to run two different YourCar objects at the same time to see if it is worth the time to go ten miles over the speed limit. So, your application should output, the route (changes in course), the total distance, the total time, and fuel consumption Hint: you can assume you know the following information. 1) the number of road segment 2) for each road segment, you have information of speed limit, length of the road segment, direction that the car is heading, the name of the road. Problem4 (40 points): YourCar Problem. (Problem-solving process is required.) Descripton: I would like you to create two new classes "YourCar" and "Your CarTrip" that will help you calculate the total distance from one point (point A) to a second point (point B), how long it will take you to get there, and if you need gas for the return trip. YourCarTrip is the application. Example: Depart UHCL (point A), take a left on to Bay Area Boulevard for 3.5 miles at 30 MPH, take a left onto 145 South for 26.3 miles at 65 MPH, exit right onto 61st street, go 2.0 miles to Stewart Drive, take a right and go 4.3 miles at 45 MPH to your destination on the right (point B). Your Car should define, at least, the instance variables that hold the number of gallons in the tank (must be input at some point), the number of miles in the trip (starts at zero), current speed (starts at zero). YourCar should also be able to change direction, change speed (increase, decrease), and determine if you need gas. Needs gas, implies you will need to calculate your fuel consumption, so assume your car averages 25 MPG at any speed. I would like you to run two different YourCar objects at the same time to see if it is worth the time to go ten miles over the speed limit. So, your application should output, the route (changes in course), the total distance, the total time, and fuel consumption Hint: you can assume you know the following information. 1) the number of road segment 2) for each road segment, you have information of speed limit, length of the road segment, direction that the car is heading, the name of the road

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

The brain emits large, slow delta waves during sleep.

Answered: 1 week ago