Lecture24 - Engineering 101 Engineering 101 Lecture 24...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Engineering 101 Engineering 101 Lecture 24 Lecture 24 Project 6 and Sorting Project 6 and Sorting Prof. Michael Falk University of Michigan, College of Engineering Announcements Announcements Project 6 Due Monday, Nov 13 at 9pm New Gradebook will be posted today Make an appointment to see me if you are concerned about your grade. Project 4 and 5 grades to be posted this weekend. Exercise 3 Exercise 3 What will this output? 1- abr 2- rba 3- acadabr 4- rbadaca Exercise 3 Exercise 3 vector <string> strings; string word=”abracadabra” int n; n=word.find(“r”); while(n != word.npos){ strings.push_back(word.substr(0,n+1)); word.erase(0,n+1); n=word.find(“r”); } strings.push_back(word); for(n=strings[1].size()-1; n>=0; n--) cout << strings[1][n]; cout << endl; Vectors of Vectors Vectors of Vectors Other Uses of of Vectors of Vectors: – Tables of data – Spatially dependent data (maze for Robot) – Matrices for linear equations – Graph representation: 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 3 4 Project 6: Top Secret Decoder Project 6: Top Secret Decoder Encryption is a fundamental process that underlies a good deal of our information driven world. It is essential for electronic bank transactions, checking your grades on- line, and protecting any other kind of secret information. Encryption underpins the internet economy. Hence, in many ways the ability to decode has become a powerful weapon that can be used for good or for ill. Project 6: Top Secret Decoder Project 6: Top Secret Decoder Decryption Program – Read a dictionary of words – Generate random codes – Check how well a code decodes a particular message – Gradually improve the code until the message is entirely decrypted Project 6: Top Secret Decoder Project 6: Top Secret Decoder Encoding Program Provided – Example of a code: abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz – Original message hello world – Encoded Message hello world Project 6: Top Secret Decoder Project 6: Top Secret Decoder Encoding Program Provided – Example of a code: abcdefghijklmnopqrstuvwxyz mnoxyzqrsabcuvwdefpjkltghi – Original message hello world – Encoded Message ryccw twfcx Exercise 1 Exercise 1 Consider a code that only includes the letters a-g. If the code is: dfagceb what does the word “cabbage” encode to? Exercise 1 Exercise 1 code is: dfagceb cabbage adffdbc Exercise 2 Exercise 2 Consider the code: dfagceb. What code would reverse the effect of applying this code? Exercise 2 Exercise 2 The code: dfagceb . The reverse code: cgeafbd Project 6: Top Secret Decoder Project 6: Top Secret Decoder encode.cpp creates code using Mutate string code = “abcdefghijklmnopqrstuvwxyz” string newcode; newcode = Mutate(code, 2) cout << newcode << endl; Could print out abcdeyghijklmnopqrsfuvwxtz Project 6: Top Secret Decoder Project 6: Top Secret Decoder encode.cpp then encodes a message using the Encode function string code =“abcdeyghijklmnopqrsfuvwxtz”...
View Full Document

This note was uploaded on 04/02/2008 for the course ENGR 101 taught by Professor Ringenberg during the Fall '07 term at University of Michigan.

Page1 / 44

Lecture24 - Engineering 101 Engineering 101 Lecture 24...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online