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

Data Description:

Key List of... Comment Example Value
Dimensions.Height Integer Unknown values are stored as 0. Unfortunately, many cars do not report this data. 140
Dimensions.Length Integer Unknown values are stored as 0. Unfortunately, many cars do not report this data. 143
Dimensions.Width Integer Unknown values are stored as 0. Unfortunately, many cars do not report this data. 202
Engine Information.Driveline String A string representing whether this is "Rear-wheel drive", "Front-wheel drive", or "All-wheel drive". "All-wheel drive"
Engine Information.Engine Type String How many cylinders are in this engine. Most cars are either a 6-cylinder or an 8- cylinder "Audi 3.2L 6 cylinder 250hp 236ftlbs"
Engine Information.Hybrid Boolean Whether this is a hybrid engine or not - that is, if it uses both an internal combustion engine and an electric motor. True
Engine Information.Number of Forward Gears Integer The number of forward gears. If no information is available, it is coded as 0. 6
Engine Information.Transmission String The full name of this type of transmission, based on its Classification and number of forward gears. "6 Speed Automatic Select Shift"
Fuel Information.City mpg Integer The miles-per-gallon this car gets on average in cities. 18
Fuel Information.Fuel Type String Whether this car takes "Gasoline", "Diesel fuel", "Electricity", "Compressed natural gas", or "E85" (a term that refers to high-level ethanol-gasoline blends containing 51%-83% ethanol). If it is unknown, it is left blank. "Gasoline"
Fuel Information.Highway mpg Integer The miles-per-gallon this car gets on average on highways. 25
Identification.Classification String Whether this is a "Manual transmission" or an "Automatic transmission". If it is unknown, it is left blank. "Automatic transmission "
Identification.ID String A unique ID for this particular car, using the year, make, model, and transmission type. "2009 Audi A3 3.2"
Identification.Make String The maker for this car. "Audi"
Identification.Model Year String The specific name/year for this car "2009 Audi A3"
Identification.Year Integer The year that this car was released. 2009
Engine Information.Engine Statistics.Horsepower Integer A measure of the engine's power. A unit of power equal to 550 foot-pounds per second (745.7 watts). 250
Engine Information.Engine Statistics.Torque Integer The torque of the engine, measured in lb/ft. When an engine is said to make "200 lb-ft of torque", it means that 200 pounds of force on a 1-foot lever is needed to stop its motion. 236

First 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.

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.

  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 Intelli J and make the code as simple as possible. Please provide note for understanding.

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. Any sort method would work such as selection sort, insertion sort or bubble sort. Whatever is suitable for you. Thanks.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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