CPE 102 Assignment 1
Read Chapter 14 from Java, How to Program (sixth ed.).
Submit your assignment via an e-mail zip-file attachment.
- Write a Copy application that does the following:
- With two arguments,
Copy file1 file2
, copy file1
to file2
.
- With one argument,
Copy file1
, copy file1
to console output.
- With no arguments, open the File Chooser to select a file for listing.
Generate an error message if file1
does not exist. Generate a warning if the
destination file file2
exists and provide a message box to query whether the
file should be overridden (default is no).
- Write a program to identify the components (chunks)
of a RIFF file. Download riff.zip for
samples of multimedia RIFF files and example programs.
- Write a program that counts the frequency of occurrence of alphabetic characters in a
group of text files. Investigate previously reported work on the frequency of occurrence of
letters in the English language and compare to your results.
- Write a program that reads an html (text) file and extracts a list of library books and due dates.
Output only the names of the books and the dates. See books.zip
for example files (or use your own).
- Write a program that checks if two files are different from one another by making a
byte-by-byte comparison.
- Write a program that displays a 256-byte section of a file as (a) characters, (b) hex,
(c) 16-bit integers, or (d) 32-bit integers. Provide user interface elements that select the
offset into the file (default 0) and whether the file is little-endian (Intel) or big-endian
(Motorola, Sun).
- Write a program that reads a document file and fills in marked fields with field-content
pairs obtained from another file.
Example:
The <noun1> in <place> falls mainly on the <noun2>.
where fields are obtained by random selections from:
noun1 rain
noun2 plain
noun1 snow
noun1 sleet
place Spain
place Dover
place Ohio
noun2 hills
noun2 street
noun2 feet
An output for this example might be:
The snow in Ohio falls mainly on the hills.
Maintained by John Loomis,
last updated 6 Jan 2001