Question
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
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