Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the text file with the following data: Car Make, Car Model, Car Price(make up your own information) You will be given a Car class

Use the text file with the following data:

Car Make, Car Model, Car Price(make up your own information)

You will be given a Car class that will contain the 3 fields, a constructor to initialize the 3 fields, and a toString method. It will also have the appropriate getters and setters in the Car class.

You will need to create a Driver class that will read the input file. You will create a Car object per record in the file, and store the Car object in an array of Cars. The array of Cars will be created as a static global variable, before the main method.

Write a method in the driver class that will find the car with the highest cost and the lowest cost. The method should also add up all the car costs, so that after the loop, you can calculate the average cost of all cars.

Rember to NOT use Buffered Reader

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions