CS 105 Lab 3
The purpose of this lab is to practice the techniques of making choices and looping. Before you begin,
please be sure that you understand the following concepts that we went over in class
1
CS 105 Review Questions
Most of these questions appeared on past exams.
1. What is the minimum number of bits needed to store a single piece of data
representing:
a. An integer between 0 and 100?
b.
1
CS 105 Lab 2
The purpose of our lab today is to explore Python operations and assignment statements, and then
begin to type in complete programs. Please create a new folder called lab02. Later today
Answers to review questions.
1. Minimum number of bits
a. 7
b. 9
c. 6
d. 38
e. 14
f. In a 300-room hotel, for example, we would need 9 bits.
2. Converting to binary and octal:
a. Binary = 1011 1110 11
Practice our problem-solving strategy
Find a partner for this exercise. Your group will be given one or more of these problems to solve. Please
write a very clear list of steps to solve the problem. Y
CS 105 Lab 4
Today, we will practice with strings and lists. On your USB drive or account, please create a new folder
called lab04, and put all of todays work inside this folder.
First, lets use the s
1
CS 105 Lab #1 Binary representation of numbers
Binary numbers are the dough we use to represent all information inside the computer. The
purpose of this lab is to practice with some binary number re
CS 105 Lab 6
In every lab so far, you have been using functions that have been provided to you by the Python system.
Today, you get to write your own functions. Functions are a great way to organize y
CS 105 Lab 5
There are two objectives to todays lab. First, I want to show you how to perform file I/O. And second,
you will write short Python programs corresponding to the practice problems you rece
CS 105 - Lab 9
Today's Objectives
Python Review. Today we'll be mastering t y . e c p statements.
r. xet
Implement one-time pads for use in cryptography and their strengths and weaknesses.
Learn ab
CS 105 - Lab 10
Today's Objectives
Prime Number Generation
Implement Diffie-Hellman Key Exchange
Implement RSA Encryption
Part 1: Diffie-Hellman Key Exchange
In class you learned about the Diffie-H
1
CS 105 Review Questions #2
In addition to these questions, remember to look over your labs, homework assignments,
readings in the book and your notes.
1. Explain how writing functions inside a Pytho
CS 105 - Lab 7
Today, you will be doing a lot with files! We will start with the basics of reading and writing and then expand upon the
pixel value work that you did in the previous lab by working on
CS 105 - Lab 8
Today, you will be implementing three different ciphers! There's a very weak Caesar cipher, a similarly weak
Transpositional cipher, and a stronger but not impenetrable Vigenere cipher.
Let's practice the Diffie-Hellman-Merkle key exchange protocol.
In other words, two people will agree on a key without actually sending it.
Alice chooses:
Example:
p = 29
q = 15
prime p =
q=
secret va