Question
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:
- 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.
- 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)
- 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.
Remember: To apply binary Search you must sort the array. Measure the time to execute binary search only when calling binary search, not on the sorting part of it.
- 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 "car.csv". Please complete it in Intelli J and make the code as simple as possible. Please provide note for understanding. Thank you.
Answer to the comment: 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.
Step 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