ENGR/CS 101 CS Session Lecture 6
Log into Windows/ACENET (reboot if in
Linux)
Start Python, create a New File, and Save As Reminder: Homework 1 is due today by
4:30pm via the submission system.
Lecture 6 ENGR/CS 101 Computer Science Session 1
ENGR/CS 101 CS Session Lecture 6 Log into Windows/ACENET (reboot if - - PowerPoint PPT Presentation
ENGR/CS 101 CS Session Lecture 6 Log into Windows/ACENET (reboot if in Linux) Start Python, create a New File, and Save As Reminder: Homework 1 is due today by 4:30pm via the submission system. Lecture 6 ENGR/CS 101 Computer Science
Lecture 6 ENGR/CS 101 Computer Science Session 1
Today: encode user entered word in uppercase
Characters For loops Characters and strings as user input
Lecture 6 ENGR/CS 101 Computer Science Session 2
Allow the user to enter a shift key letter in
Repeat until the user enters '#' for a word
Allow the user to enter a plaintext word in uppercase
Compute and display the corresponding ciphertext
Lecture 6 ENGR/CS 101 Computer Science Session 3
Lecture 6 ENGR/CS 101 Computer Science Session 4
Lecture 6 ENGR/CS 101 Computer Science Session 5
E.g., 'A', '3', '?'
Newline – '\n' Tab – '\t' Single quote – '\''
Lecture 6 ENGR/CS 101 Computer Science Session 6
ord(ch) – return ASCII numeric equivalent of ch chr(num) – return character corresponding to
Lecture 6 ENGR/CS 101 Computer Science Session 7
Lecture 6 ENGR/CS 101 Computer Science Session 8
To find the cipher letter, we determine the index of
This will be the index of the ciphertext letter, except
The modulus operator symbol is %
Lecture 6 ENGR/CS 101 Computer Science Session 9
Lecture 6 ENGR/CS 101 Computer Science Session 10
Lecture 6 ENGR/CS 101 Computer Science Session 11
Lecture 6 ENGR/CS 101 Computer Science Session 12
Lecture 6 ENGR/CS 101 Computer Science Session 13
Write a function the encodes a plaintext word into
Receives: plaintext word, shift key letter Returns: ciphertext word
Lecture 6 ENGR/CS 101 Computer Science Session 14
Lecture 6 ENGR/CS 101 Computer Science Session 15
Lecture 6 ENGR/CS 101 Computer Science Session 16
Input: shift key, plaintext string Output: ciphertext string
Lecture 6 ENGR/CS 101 Computer Science Session 17
Lecture 6 ENGR/CS 101 Computer Science Session 18
Lecture 6 ENGR/CS 101 Computer Science Session 19
Lecture 6 ENGR/CS 101 Computer Science Session 20
Lecture 6 ENGR/CS 101 Computer Science Session 21