Answers for Practice Problem A File 1ST-EXP.TXT ( a + b ) * ( c - d ) File 2ND-EXP.TXT - b + ( b * b - 4 * a * c ) File 3RD-EXP.TXT ( e / f + r % s ) + ( d * c - ( - b ) / a ) Answers for Practice Problem B File SURVEY1.TXT Start-end distance: 2.64704 The survey does not close. File SURVEY2.TXT Start-end distance: 0.683779 The survey closes. Answers for Problem A File MESSAGE1.TXT So, here is a simple "example" on two lines. File MESSAGE2.TXT The XYZ Republic uses a simple encryption method to send messages between its diplomats. Both sender and receiver have a copy of the file MASKS.TXT which contains the numbers 0 to 255 in random order. Each number is separated from the next by one space. To send a message, the sender performs two actions on each character of the message (including all whitespace characters and punctuation): 1. the bits of the character are reversed (so, if the first character is 'S' whose ASCII code is 01010011, the reversal produces 11001010) and 2. the reversed value is exclusive ORed with the first number in MASKS.TXT (this happens to be 28 or 00011100 in binary which is exclusive ORed with the 11001010 to get 11010110). This value is then written as a positive or unsigned number (in this case 214) to the encrypted message file. Subsequent characters of the message use consecutive numbers from MASKS.TXT for exclusive ORing. If there are more than 256 characters in the message, the numbers in MASKS.TXT are reused from the beginning as often as necessary. Thus, for the message Answers for Problem B File SEEWORD.PAS 1 2B 4B 4E 2EB 5B 4 7 8 5E 1E File SIMULATE.PAS 1 2B 4B 4E 2E 2B 7 8B 8E 2E 2 3B 4 7B 7E 3EB 2E 2B 7 7B 7 7E 2E 2B 7 7 2E 2B 4B 5B 7B 7E 5E 5B 5E 4E 2E 2B 2EB 6B 7B 7E 8 7B 7 8 7E 8 7B 7E 8 6E 1E File COPY.PAS 1B 5B 5B 5E 5E 1E File FAKELOAD.PAS 1 2B 7 8B 5B 7 5E 8E 2E 2B 5B 7 5E 5 7 8B 4 8E 2E 2B 4 2E 2B 7 8 4 4 2E 2B 7 8B 5B 5B 5E 5E 8E 2E 2B 4B 4 7 8 4E 2E 2B 5 7B 5 7 8 7B 7E 8 7E 8 7 8 2E 2B 2E 2B 7B 7E 8B 8E 2E 2B 5 2E 2 2B 4 4 7 4B 7 4E 7 8 2E 2B 7B 7E 8 2EB 5B 7 5E 4B 4E 7B 4 6B 5B 5E 6E 7E 8B 7 7 4 7B 4 7E 8B 4 4 8E 8E 2E 2B 5B 7 5E 6B 7 8B 7B 7E 8E 6 E 7 2E 2B 4B 7B 7E 4E 2E 2B 7 8B 7 7 7B 7E 8E 2E 2B 7 7 4B 4B 7 7 4E 4E 4 2E 2B 7 5B 5E 7B 5B 5E 7E 2E 2B 2EB 5B 5E 7B 4 4 7E 8B 4B 4E 4 4 4 8E 5 6B 5B 7 5E 6E 1E Answers for Problem C File REQUEST1.TXT IP Address Start End ** Idle time ** 0 20 144.80.128.17 20 32 ** Idle time ** 32 47 144.80.128.18 47 66 144.80.128.19 66 96 144.80.128.22 96 113 144.80.128.21 113 134 144.80.128.20 134 149 ** Idle time ** 149 158 144.80.128.23 158 180 144.80.128.24 180 196 144.80.128.27 196 206 144.80.128.28 206 229 144.80.128.25 229 244 144.80.128.29 244 260 144.80.128.26 260 293 144.80.128.30 293 301 ** Idle time ** 301 310 144.80.128.31 310 319 144.80.128.33 319 336 144.80.128.32 336 348 Answers for Problem D File PUZZLE7.TXT DAFT*SI DOLE*IN ANON*LG YEWS*KR **EOREA TORRENT IRS*D*E File PUZZLE9.TXT BOW*PAPA* AVA*OPEN* RED*SET*T ERECTS*BE ***AS*PLA DEER*SOAR ADD*DARNS MI*LIVED* STRIPES** Answers for Problem E File SENTENCE.TXT Sentence 1 is NOT in the language Sentence 2 is VALID Sentence 3 is NOT in the language Sentence 4 is NOT in the language Sentence 5 is NOT in the language Sentence 6 is VALID Sentence 7 is VALID Sentence 8 is VALID Sentence 9 is NOT in the language Sentence 10 is VALID Sentence 11 is VALID Sentence 12 is VALID Sentence 13 is VALID Sentence 14 is VALID Sentence 15 is NOT in the language File GOODBAD.TXT Sentence 1 is VALID Sentence 2 is VALID Sentence 3 is VALID Sentence 4 is VALID Sentence 5 is VALID Sentence 6 is VALID Sentence 7 is VALID Sentence 8 is VALID Sentence 9 is VALID Sentence 10 is VALID Sentence 11 is VALID Sentence 12 is NOT in the language Sentence 13 is NOT in the language Sentence 14 is NOT in the language Sentence 15 is NOT in the language Sentence 16 is NOT in the language Sentence 17 is NOT in the language Sentence 18 is NOT in the language Sentence 19 is NOT in the language Sentence 20 is NOT in the language Answers for Problem F Enter destination node: F The fastest route from A to F is ABF with a delay of 12 The second fastest route from A to F is ACF with a delay of 13 Enter destination node: Q The fastest route from A to Q is APQ with a delay of 26 The second fastest route from A to Q is ADGQ with a delay of 28 Enter destination node: J The fastest route from A to J is ADGHKJ with a delay of 29 The second fastest route from A to J is ABFIJ with a delay of 30 The second fastest route from A to J is AEGHKJ with a delay of 30 The second fastest route from A to J is ACEGHKJ with a delay of 30 Enter destination node: R The fastest route from A to R is ABOR with a delay of 39 The second fastest route from A to R is ABFOR with a delay of 39 Enter destination node: W The fastest route from A to W is AW with a delay of 11 The second fastest route from A to W is ABFIW with a delay of 38 Enter destination node: Y The fastest route from A to Y is ADGHKJY with a delay of 44 The second fastest route from A to Y is ABFIJY with a delay of 45 The second fastest route from A to J is AEGHKJY with a delay of 45 The second fastest route from A to J is ACEGHKJY with a delay of 45 Enter destination node: T The fastest route from A to T is APQUT with a delay of 43 The second fastest route from A to T is ADGHKT with a delay of 44 The second fastest route from A to T is APQT with a delay of 44 Enter destination node: X The fastest route from A to X is ABOX with a delay of 37 The second fastest route from A to X is ABFOX with a delay of 37 Enter destination node: V The fastest route from A to V is ADGLNSV with a delay of 46 The second fastest route from A to V is AEGLNSV with a delay of 47 The second fastest route from A to V is ACEGLNSV with a delay of 47