Open In Colab

Warm-up: Making a PB+J sandwich

Think about the process of making a peanut butter and jelly sandwich.

How would you describe the sequential steps involved in making the sandwich? Why does the word sequential matter here?

Let’s say both you and a friend both wrote down the process for creating your own versions of pb+j, but have a different number of steps (you have 10 while they have 5). How can this be?

#Discussion: Cafe Orders

You want to create a program that sends the drink a customer selects at the automated coffee shop to the barista. The program should prompt the user to select which drink they want, if it’s hot or iced, and then send the drink to the barista.

Design pseudocode to show the steps of the program.

Pseudocode: Fill in the steps your program should take

Step 1:

Step 2:

Step 3:

Step 4:

Once you have this, grab a partner and discuss where could you add improvements. What would you have to add so a customer can select multiple drinks? How about adding a flavoring? What happens when a user enters an invalid option?

Add any steps you think would be important to replicating the ordering process at a cafe.

Discussion: Decipherying Lighthouse Codes

You are a part of a network of spies within a lighthouse organization. Your co-conspirators have left a clue for you. You see five lighthouses and want to remember which are lit and which are not.

Describe how you would remember this information if all you could share was a number. Think of multiple ways this could be done.

Screenshot 2024-09-08 at 12.45.12 PM.png

Concept Checks

These are meant to test (very informally) how the concepts stuck during the lecture. Chat about each question with a partner without looking back at the material. After chatting, beef up your initial answers by revisiting the notes or textbook.

Languages in Computer Science

Explain the concept of binary numbers to a non-technical person, and how binary is used in computers.

What language(s) do we use to translate a human’s native language (like English) into a computer’s native language? Hint: we’re learning one of these in our course.

Algorithms

Describe what algorithms are, and what it means to think algorithmically.

Give two examples of algorithms in everyday life.


Exercises

To add your answers to the questions below you’ll need to add new text boxes. To do so, click on the question you want to answer. A box should appear that says +Text. Click this to create a new text box and start typing your answer. When completing question 1, you can create a single text box and number your responses.

Cafe orders flowchart

Revisit your cafe psuedocode from earlier. Add the following labels to the pseudocode to identify: * which steps require information to be remembered (v) * which steps do a calculation (c) * which steps display information (p) * which steps take in information (i)

Note, some steps could have multiple labels