Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Mark McCormick Used Car Lot needs a report and search ability of their inventory of the 2 5 best - selling cars of the

The Mark McCormick Used Car Lot needs a report and search ability of their inventory of the 25 best-selling cars of the year. You have been provided with a file containing a list the 25 best-selling cars. The inventory data is stored in a file named carinventory.txt. The data for each car is stored on two lines in the file and the data is space delimited. The below data must be read in from the specified data file and stored in arrays accordingly.The structure of each record of the file is as follows:LineItemType1DescriptionString2Serial Numberint2Quantityint2Costfloat2Pricefloat2Color codeint Name your class "CarReport". Use a minimum of 3 methods. Use printf to format and display PRICE with $ and 2 decimal places. Use a loop to read in the data from file. Use arrays to store data. Use the File/PrintWriter classes to read/write data to/from file Your program needs to be menu driven. You will allow the user to produce the report as displayed on these instructions (sorted by serial number order OR sorted by description in alphabetical order. The user will have the option to print the report to the screen, to an output file, or both. When the user selects the option to search, you need to prompt the user for the cars serial number. After the user enters a serial number, your program should search and display all of the associated data on one line for that ONE car to the screen.The data contains codes for each color. You will need to create a method to convert the code to the color description as follows:Color Chart10White11Black12Blue13Silver14Red15Green Menu Example:Menu1) Report by Serial Number OR Report by Description2) Search by Serial Number3) ExitReport ExampleSerial #DescriptionColorQuantityCostPriceProfit=============================================================41345Chevy MalibuBlue018048.0022774.004726.0068507Chrysler PacificaBlue133201.0043547.0010346.0037291Subaru CrosstrekBlue726390.0029025.002635.0056797Mazda CX-5Red617049.0022714.005665.0011689Subaru OutbackWhite732521.0035426.002905.0098437Jeep WranglerRed327338.0034221.006883.0071220Ford ExplorerWhite129067.0033409.004342.0021744Toyota HighlanderBlack622936.0027101.004165.0097316Honda CivicBlack526267.0032302.006035.0053135Honda AccordBlue222107.0023882.001775.0036892Hyundai TucsonBlue332405.0036961.004556.0043532Chevy EquinoxRed730910.0041729.0010819.0028248Toyota CorollaGreen119385.0021914.002529.0039764Tesla Model 3Green721815.0023016.001201.0072583Toyota TacomaGreen532225.0036063.003838.0022947Jeep GrandCherokeeGreen021292.0026749.005457.0088156Nissan RogueWhite518456.0020969.002513.0078666GMC SierraWhite525920.0034211.008291.0052331Toyota CamryGreen631709.0038057.006348.0064625Honda CR-VWhite433827.0042395.008568.0072329Tesla Model YBlue020592.0022916.002324.0058137Toyota RAV4Blue125522.0030246.004724.0025819Ram PickupBlack121712.0023055.001343.0024310Chevy SilveradoWhite021520.0022634.001114.0059055Ford F-SeriesRed323042.0027962.004920.00 Total Cars86 Total Cost635256.00 Total Retail753278.00 Total Profit118022.00
image text in transcribed

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 Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

What abilities are possible because humans use symbols?

Answered: 1 week ago