Spring 2001
(Sections 03 & 06 only) |
Follow Up to Lab # 8 |
Part 1: Testing your CaesarCipher program
Download these files to your lab-practice folder:
Execute these commands until you cannot read the text that results (note: if your program loops, asking the person if they want to try another set, each of these will fail at that point -- that is acceptable; the question is whether you can read the secret message before that error (i.e., you decode it correctly) or whether your program balks at even trying to decode it (i.e., it doesn't work right on even the first round) as specified):
java SimpleCaesar <secret1.txt
java SimpleCaesar <secret2.txt
java SimpleCaesar <secret3.txt
java SimpleCaesar <secret4.txt
java SimpleCaesar <secret5.txt
Once you know on how many of these your code does work, then repeat the exercise, executing the following commands exactly. Take care with spaces and non-alphabetic characters (you should not see any output unless you type
out the contents of the plain.txt
file):
java SimpleCaesar <secret1.txt >plain.txt
java SimpleCaesar <secret2.txt >>plain.txt
java SimpleCaesar <secret3.txt >>plain.txt
java SimpleCaesar <secret4.txt >>plain.txt
java SimpleCaesar <secret5.txt >>plain.txt
Print the file plain.txt
(open it in pfe and print from there, if need be). Write your name on it, and hand it in. Staple to it a copy of your code for this lab and hand that in. (This part should take you less than half the lab period! Hand this much in before the end of this lab period: no late-submissions will be counted towards this lab's grade).
FYI: #1 tests the basic lab requirements; #2 tests an oversize key (i.e., greater than the number of letters in the plain alphabet); #3 and #4 test negative keys (a special case, and a more general case, respecively, which will give clues to the approach your code used); and #5 tests an oversize negative key (it will not work if either #2 or #4 fail). For a passing grade at all, your code should handle #1. To meet the general specs in the lab write-up, it should also handle #2. The others are extra features, for those of you who think you have really mastered this activity (worth correspondingly higher grades).
Part 2: Practice with 2-D arrays
Write a class, with its own driver, that does the following:
87 | 93 | 91 | 88 | 81 | 98 |
81 | 85 | 91 | 88 | 94 | 97 |
99 | 72 | 93 | 71 | 95 | 85 |
Run the file, and append a sample run as a comment at the end of your code. Print that out (the code plus the sample run), and hand that in before the end of lab (full credit) or at the START of your next lecture (10% penalty). Note: there will be an entirely different activity to work on during lab on Thursday.
Back: | The opening page of this lab |
Up: | This Instructor's CSC-101 HomePage |
Way Up: | This Instructor's HomePage |