Question: (Write/read data) Write a program to create a file named Exercise12_15.txt if it does not exist. Write 100 integers created randomly into the file using

(Write/read data) Write a program to create a file named Exercise12_15.txt if it does not exist. Write 100 integers created randomly into the file using text I/O. Integers are separated by spaces in the file. Read the data back from the file and display the data in increasing order.

Following Modifications:

After writing the file to disk, the input file should be read into an array, sorted using the static Array.sort() method from the Java API and then displayed in the terminal window with each of the numbers on a separate line (maximum grade of 8 points if the sort is missing)

Sorting of arrays was covered in CST112 and in Chapter 6 of the textbook; you will receive up to 9 out of ten (10) points for this assignment if you read the input file into an array of 100 elements and sort the array using either a selection or insertion sort before writing the list of numbers to the terminal window

The maximum number of points for this assignment is 7 out of ten (10) if you simply write the input file to the terminal window without sorting the list

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!