CST141 Project 6: Chapter 12
Reformat Java source code exercise
--or--
Write/read sorted data exercise
-
Complete Exercise 12.15 written with the following modifications
(this is a partial-credit 7½ or 8
or 9 point assignment):
-
Write a program to create a file name project6.txt.
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.
-
After writing the file to disk, the input file should be read into an array,
sorted using the
static Arrays.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
out of ten (10) points)
-
Sorting of arrays was covered in CST112 and in Chapter 6 of the
textbook; however for this option 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
(maximum grade of 9
out of ten (10) points)
-
Or simply write the input file to the terminal window without sorting the list
(maximum grade of 7½
out of ten (10) points)
-
Complete Exercise 12.12 as written with the following modifications
(this is the full-credit 10 point assignment):
-
Using the
showOpenDialog
method from class JFileChooser
,
open and read an original Java source code file with a ".java" extension
(this file must be submitted with the project)
-
Process the source code as per the instructions in the textbook
using
String
manipulation methods
-
Using the
showSaveDialog
method from class JFileChooser
,
write and save the updated Java source code file also with a ".java" extension
-
It is not necessary to "invoke
the program from the command line" as specified on page 556 since
we have not covered this technique in class; rather just hard code the
filename into the program
-
Students may work on all projects in teams of two or three,
and, if so, all students in the group must submit the same project to their own dropboxes
in Blackboard. In the text box's dropbox, as well as in the source code documentation
(comments), state the name(s) of the classmate(s) with whom you worked.
-
The completed project with a copy of the class file (the *.java file)
submitted electronically via an attachment to a
Blackboard
dropbox is due to Prof. Struck by 11:59 p.m. on the date specified in the course outline.