CPE 102 Assignment 1

Read Chapter 14 from Java, How to Program (sixth ed.).

Submit your assignment via an e-mail zip-file attachment.

  1. Write a Copy application that does the following: 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).

  2. Write a program to identify the components (chunks) of a RIFF file. Download riff.zip for samples of multimedia RIFF files and example programs.

  3. 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.

  4. 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).

  5. Write a program that checks if two files are different from one another by making a byte-by-byte comparison.

  6. 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).

  7. 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