Create a class called Car to represent a car. It should have four private instance variables: A String for the make, a String for the model

Create a class called Car to represent a car. It should have four private instance variables: A String for
the make, a String for the model, an int for the year and an int for the mileage. The class should include
a four-argument constructor and get and set methods for each instance variable. Override the method
toString which should return the Car information in the same format as the input file (See below).
Read the information about a car from a file that will be given to you on Blackboard, parse out the four
pieces of information for the Car using a StringTokenizer, instantiate the Car and store the Car object in
two different arrays (one of these arrays will be sorted in a later step). Once the file has been read and
the arrays have been filled, sort one of the arrays by Make using Selection Sort.
Display the contents of the arrays in a GUI that has a GridLayout with one row and two columns. The
left column should display the cars in the order read from the file, and the right column should display
the cars in sorted order

WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
šŸ‘‹ Hi, how can I help?
Scroll to Top