print("Hello World!")
Hello World!
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.
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.
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.
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.
Describe what algorithms are, and what it means to think algorithmically.
Give two examples of algorithms in everyday life.
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.
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
Let’s try our hand at writing some code! Our main goal of this exercise is understanding how the print command works, and in what circumstances we may experience errors.
When asked to explain, you can either add a text box below these instructions, below each code chunk, or edit these instructions by double-clicking.
print("Hello World!")
. We sometimes call this executing code. You can either click the play button to the left, or click on the code chunk and use the shortcut Ctrl + Enter.Hello = "Hi"
, and the second is print(Hello)
. To do two commands in one code chunk press Enter to go to a new line after your first command.print(hello)
. How can you tell this command was the one to cause an error?print("Hello World!")
Hello World!