CS1

TT Securities, Incorporated

In this assignment students work either individually or in pairs to manage and analyze stock prices via a text menu. Students must write a function that asks the user what they want to do, providing nine options: input a new list of stock prices, print the current list, find various statistics, find the best day to buy/sell the stock in question, and quit the menu. Students may not use built-in functions, and must therefore write functions like sum, min, and max themselves using loops. In addition to reviewing i/o and loops, this assignment requires students to decompose their code thoughtfully. It is particularly useful for students who are new to loops and need additional practice with decomposition.

Pi from pie

In this assignment students work either individually or in pairs to estimate pi with a Monte Carlo simulation. Students simulate throwing darts at a square with a circle inscribed in the middle by generating random pairs of (x, y) coordinates, keeping track of the ratio of darts that hit the circle. They must write two functions: one that throws a given number of darts, and one that continues throwing darts until the estimated value for pi is within a given tolerance. This assignment reviews random number generation and loops, as well as requiring students to adequately comment and decompose their code. It is particularly useful for students who need additional practice with loops.

Looks Good!

In this assignment students work either individually or in pairs to write a series of image-processing functions. Using list comprehension, students must write functions that invert the colors of an image, change the colors to greyscale, change the image to black and white, flip the image, and mirror the image. Students are also encouraged to be creative and come up with their own alterations. This assignment covers list comprehension on multidimensional lists. It is particularly useful for students who are new to multidimensional lists and need additional practice using list comprehension on them.

Strings

In this lab students collaborate using Pair Programming to explore strings in Python. Using iteration, students create a program that loops through strings and produces one of a couple different outputs. Students are required to work together on this lab and the instructor recommends periodic performance checks to ensure that adequate progress is being made by both students. This lab is ideal for students looking to get additional practice working with strings and collaborating on program development and analysis through Pair Programming.

Stars and Triangles

In this lab (Lab 5) students collaborate using Pair Programming to explore looping and conditionals in Python. Using loops (e.g. 'while) and conditionals ('if/else'), students complete a series of activities that involve creating ASCII art and formatted output.

Exploring Repetition

In this lab students collaborate using Pair Programming to explore looping (iteration) in Python. Using various loop structures, such as 'while' and 'for', students must complete a series of tasks that illustrate the use of iteration. Frequent use of guiding questions helps students to both explore these ideas together and to discuss how the looping structures can best be used to complete the task. These activities are ideal for students interested in gaining experience with implementing and evaluating loops, as well as those who are looking for an example of how to implement Pair Programming in a CS1 lab section.

Engagement Excellence

Conversions and Compressions

In this assignment students work either individually or in pairs to write functions that convert between different bases and compress/decompress black and white images. Students must write functions that convert between bases between 2 and 10 and that add binary numbers. They must also write a basic compression/decompression algorithm for black and white images. This assignment reviews strings and requires students to use functions that they wrote earlier. It is particularly useful for students who are new to representing numbers in different bases and need additional practice with strings and recursion.

Conditionals and Selection Statements

In this lab students explore conditionals in Python. Using boolean expressions and conditional logic, students are required to predict the outcome of multiple expressions and then use the Python interpreter to obtain the actual outcome for each statement. Through a series of activities students gradually build programs that demonstrate an understanding of how to use these fundamental constructs in CS. These series of activities are ideal for students looking for more experience with boolean operators and in creating small programs using conditional logic.

IDLE and Basics of Python Programming

In this lab students explore the basics of Python. Using the Python Interpreter in IDLE, students create a series of programs that cover performing mathematical calculations and concatenation with strings. After building a program to calculate information about a particular sphere, students get to create their own project based on the premise of planning a trip to Europe. This activity is ideal for students who are both new to programming and new to Python.

Sorting out Caesar!

In this assignment students work either individually or in pairs to write functions that encode and decode a Caesar cipher, along with several other sorting and string problems. Students must write functions that encipher a message by rotating the letters and decipher a message by looking at letter frequencies in the enciphered message. Additionally, students must write functions that sort a binary list, sort a general list, find the number of characters shared between two strings, and find the least common subsequence of two strings. In addition to requiring students to work with recursion, strings, and list comprehension, this assignment requires students to design their own algorithms. It is particularly useful for students who are comfortable with the topics covered but need additional practice designing algorithms.

Subscribe to CS1