Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program Planet Record Sorting Sorting is one of the most common applications of computer science. Java has built-in sorting methods that allow you to quickly
Program Planet Record Sorting Sorting is one of the most common applications of computer science. Java has built-in sorting methods that allow you to quickly and efficiently sort items in different ways. In this program, you will read in records from a file, sort them based on one of the fields of the records using Java's built-in sorting routines, and then write the sorted list to the console as a table. Things you will learn Creating simple classes Comparators and Java's sorting routines Reading input from files and formatting output. Specification In this assignment, you will implement a planet information sorter program. Your program must include the following elements: l. A class called "Planet" to hold a planet's information. 2. Different comparators to compare the different attributes of planets. Planet records will be specified in a file, one record per line. Each line of the file will have five comma-separted fields with no spaces between them (this is called a csv file). The fields will be: planetName, year Discovered. mass, radius orbit Period An example file is shown below: TrES-2b, 2006, 1.197, 1.247, 2.47 HAT-P-7b, 2008, 1.781, 1.419, 2.204 Kepler-4b, 2010, 0.077,0.357, 3.213 The program must take two pieces of input, either as command line arguments, or by prompting the user for input
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