Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

City mpg Classification Driveline Engine Type Fuel Type Height Highway mpg Horsepower Hybrid ID Length Make Model Year Number of Forward Gears Torque Transmission Width

City mpg Classification Driveline Engine Type Fuel Type Height Highway mpg Horsepower Hybrid ID Length Make Model Year Number of Forward Gears Torque Transmission Width Year
18 Automatic transmission All-wheel drive Audi 3.2L 6 cylinder 250hp 236ft-lbs Gasoline 140 25 250 FALSE 2009 Audi A3 3.2 143 Audi 2009 Audi A3 6 236 6 Speed Automatic Select Shift 202 2009
22 Automatic transmission Front-wheel drive Audi 2.0L 4 cylinder 200 hp 207 ft-lbs Turbo Gasoline 140 28 200 FALSE 2009 Audi A3 2.0 T AT 143 Audi 2009 Audi A3 6 207 6 Speed Automatic Select Shift 202 2009
21 Manual transmission Front-wheel drive Audi 2.0L 4 cylinder 200 hp 207 ft-lbs Turbo Gasoline 140 30 200 FALSE 2009 Audi A3 2.0 T 143 Audi 2009 Audi A3 6 207 6 Speed Manual 202 2009
21 Automatic transmission All-wheel drive Audi 2.0L 4 cylinder 200 hp 207 ft-lbs Turbo Gasoline 140 28 200 FALSE 2009 Audi A3 2.0 T Quattro 143 Audi 2009 Audi A3 6 207 6 Speed Automatic Select Shift 202 2009
21 Automatic transmission All-wheel drive Audi 2.0L 4 cylinder 200 hp 207 ft-lbs Turbo Gasoline 140 28 200 FALSE 2009 Audi A3 2.0 T Quattro 143 Audi 2009 Audi A3 6 207 6 Speed Automatic Select Shift 202 2009

Task:

The idea of this project is to create a text-based application with the following options:

  1. List all cars. This option will read from the file and when the user selects this option, the program will list all the cars in the file.
  1. Find via Linear search. This option will allow the user to type a model of the car (ID field in the dataset) and it should print out the information about the car searched, the amount of time it took to find the car using linear search. For this option, create a class called SearchMethods and implement the method :

public static > int linearSearch(T[] data, int min, int max, T target)

  1. Find via Binary search. This option will allow the user to type a model of the car (ID field in the dataset) and it should print out the information about the car searched, and the amount of time it took to find the car using binary search. For this option create, a class called SearchMethods and implement the method:

public static >

int binarySearch(T[] data, int min, int max, T target)

in both 2 and 3 the binary and linear search methods return the position in the array where the elements are found.

Apply binary Search to the array. Measure the time to execute binary search only when calling binary search, not on the sorting part of it.

  1. Option to quit the program.

Special Note: The excel sheet table is given for your convenience. You can just copy and paste the above data. The name of the spreadsheet would be "vehicle.csv". Please complete it in JAVA and make the code as simple as possible. Please provide note for understanding. Thank you.

Additional Info: There is a slide bar below the question which can be used to go right and view the rest of the question that is not visible all at once. The table can be copied and pasted to an excel spreadsheet if it is not properly visible here. The data type and description are also included. Thanks for your help.

Answer to the comment: Dear Expert, the programming language is JAVA and the car class is can be anything. For example, it can be named "Vehicle". Thanks.

Answer to the second comment: Dear Expert, since the target parameter is not mentioned, the target parameter can be any number. For example, it can be 10 or 20. Whatever you feel like you can work on. Thanks.

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

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions