subject

Use BlueJ to write a program that reads a sequence of data for several car objects from an input file. It stores the data in an ArrayList list. Program should work for input file containing info for any number of cars. (You should not assume that it will always be seven lines in the input file). Use notepad to create input file "inData. txt". File should be stored in the same folder where all files from BlueJ for this program are located.

Class Car describes one car object and has variables vin, make, model all of String type, cost of type double, and year of int type. Variable vin is vehicle identification number and consist of digits and letters . In addition, class Car has methods:

public double getCost() // returns car’s cost

public String getMake() // returns car’s make

public boolean isExpensive() // returns true if car has cost above 30000 and false

//otherwise

public boolean isAntique() // returns true if car’s has above 50 years, and false

// otherwise

public String toString() // returns string with all car’s data in one line

// separated by tabs.

Design class CarList that has instance variable list of ArrayList type. Variable list is initialized in the constructor by reading data for each car from an input file. Each line of input file "inData. txt" has vin, make, model, cost, and year data in this order, and separated by a space. The data for the first five cars in the input file should be as follows:

1234567CS2 Subaru Impreza 27000 2017

1233219CS2 Toyota Camry 31000 2010

9876543CS2 Ford Mustang 51000 1968

3456789CS2 Toyota Tercel 20000 2004

4567890CS2 Crysler Royal 11000 1951

Add remaining two rows for the two additional cars of your choice.

Class CarList also has the following methods:

public void printList() // Prints title and list of all cars (each row prints one car)
public void printExpensiveCars() //Prints "List of expensive cars:" followed by
// list of expensive cars (one car per row)

public Car cheapestCar() // Method returns Car object with lowest cost.
public int countCarsWithModel(String model) // Method accept model and
// returns count of cars with given model.

//Method antiqueCarList is extra credit.

public ArrayList antiqueCarList () // Returns ArrayList of all antique
//cars from the list.

The last three methods just return the specified data type. Do not print anything within those methods. Just return result, and have explanation printed at the place where those methods are invoked.

Class TestCarList will have main method. In it, instantiate an object from CarList class and use it to invoke each of the five methods from CarList class.

Do not forget to append throws IOException to the constructor of CarList class and main method header in class TestCarList. In addition, you have to provide

import java. io.*;

import java. util.*;

in order to use Scanner and ArrayList classes from Java.

SUBMIT a single word or PDF document named p1yourLastNameCS152 with the following:

Your name, class section and project number and date of submission in the upper left corner
Copy of the code for each class in separate rectangle (table of size 1x1 with single cell)
Copy of your input file
Picture of program run from BlueJ.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:40
Amain idea is supported, explained, or expanded on with a numbers b. a concluding statement c. details d. a topic sentence. im e paragraphs reset nex next
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
Answers: 1
You know the right answer?
Use BlueJ to write a program that reads a sequence of data for several car objects from an input fil...
Questions
question
Mathematics, 14.07.2020 01:01
question
Mathematics, 14.07.2020 01:01
question
Mathematics, 14.07.2020 01:01