Question: JAVA HELP . . Question: . Write a Java console application that reads, sorts, and writes planet data. Create text file PlanetsIn.txt and paste this

JAVA HELP

.

.

Question:

.

Write a Java console application that reads, sorts, and writes planet data. Create text file PlanetsIn.txt and paste this data into it:

.

Planet Diameter (miles) Length of Day (hours)

Mercury 3032 4222.6

Venus 7521 2802.0

Earth 7926 24.0

Moon 2159 708.7

Mars 4221 24.7

Jupiter 88846 9.9

Saturn 74897 10.7

Uranus 31763 17.2

Neptune 30775 16.1

Pluto 1485 153.3

.

Here is the file specification for PlanetsIn.txt:

.

Field Type Start-End

Planet string 1-14

Diameter (miles) integer 15-21

Length of Day (hours) real 22-40

-This file contains a header row.

.

Read and parse the data into three parallel arrays: planets, diameters, and lengths. Create method printArrays to print the unsorted data including the header row. Sort the data by diameter using a bubble sort, and use method printArrays to print the sorted data including the header row. Note that when data is sorted by diameter and values are swapped in that array, corresponding values must also be swapped in the other two arrays so that the name and length stay with the correct diameter. Write the header row and sorted data per the file specification to text file PlanetsOut.txt file.

.

Note: Please include comments explaining your code. Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!