Course Level
CS1
Knowledge Unit
Fundamental Programming Concepts
Collection Item Type
Assignment
Synopsis

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.

Recommendations

Integrate pair programming when it is appropriate for students to collaborate on a lab, assignment, or project. The “driver” controls the mouse and the keyboard, while the “navigator” makes suggestions, points out errors, and asks questions. Partners routinely switch roles to gain the benefits of each role.

Engagement Highlights

Places CS topics in a real-world context (stock price analysis) to provide Meaningful and Relevant Context. Employs Worked Examples (w/ Subgoals) by clearly defining intermediate steps that students can complete to produce the finished program. Incorporates Student Choice by permitting the implementation of additional features for extra-credit.

Materials and Links

Computer Science Details

Programming Language
Python

Material Format and Licensing Information

Creative Commons License
CC BY-NC