2

Sorting an Array of Records

 2 years ago
source link: http://programmingbydoing.com/a/sorting-an-array-of-records.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Sorting an Array of Records
  • Author: Graham Mitchell
  • Filename: SortingAnArrayOfRecords.java

Sorting an Array of Records

Repeat the previous assignment. However, once you've read in the car data from the file, then sort the array of cars by year. Then, print it out (now sorted).

From which file do you want to load this information? cars.txt
Data loaded.

Data sorted.

Car 1
	Make: Ford
	Model: Mustang
	Year: 1966
	License: AZUCAR

Car 2
	Make: Chevrolet
	Model: Chevette
	Year: 1980
	License: J43-SMB

Car 3
	Make: Toyota
	Model: Camry
	Year: 1985
	License: 622-VRX

Car 4
	Make: Honda
	Model: Civic
	Year: 1993
	License: 883-RS9

Car 5
	Make: Dodge
	Model: Neon
	Year: 1996
	License: G74-LLC

©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK