Difference: Lab8 (2 vs. 3)

Revision 32015-11-01 - JimSkon

Line: 1 to 1

Lab 8

Due: Nov 12, 11:55pm

Line: 41 to 40
 Consequently, “Hey” would be transmitted as “Ro$.”

Write a program that decrypts the intercepted message. You only know that the key used is a number between 1 and 100. Your program should try to decode the message using all possible keys between 1 and 100. When you try the valid key, the message will make sense. For all other keys, the message will appear as gibberish.


Problem 2

Write a sorting function that is similar to Display 7.12 in Chapter 7 except that it has an argument for a vector of ints rather than an array. This function will not need a parameter like number_used as in Display 7.12, since a vector can determine the number used with the member function size(). This sort function will have only this one parameter, which will be of a vec- tor type. Use the selection sort algorithm (which was used in Display 7.12).

Sort the following lists and turn in:

  1. 34,65,23,54,93,36,13,78,34,91,23,34,55,73
  2. 6,5,6,2,7,2,5,4,7,4,5,3,2,3
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback