Directions
All lab check-off deadlines are at 11:59PM.
(However, you need to get checked off by a TA or lab assistant, so you last chance to get checked off is during lab or office hours.)
To get checked off, you should prepare answers to the specific questions for each lab. You shouldn’t feel compelled to memorize every single detail of lab. The goal here to make sure you’re on track with CS10 and you should be comfortable with the higher level concepts for each question. For each lab the first questions are the biggest ideas, and the later questions are for your own benefit and review.
Remember: Even if you miss a check-off deadline, you can still get 50% credit for any lab check off at any time during the semester.
Week 1: Labs 1,2,3:
Lab 1: Welcome to Snap!
- No check-off for this lab!
Lab 2: Build Your Own Blocks
Required
- Show your field of flowers (last page of lab).
- Why should you Build Your Own Blocks? Give a reason that someone may create a custom block.
- What are some different ways to achieve repetition? Name at least 2.
- Show your random-walk sprite.
- Show your
draw square-leaved flower...
block.
More Self-Check Questions
- Did you customize your flower block in any ways? Be creative.
- Show your customized bug dance.
Lab 3: Conditionals and Reporters
Required
- What is a Boolean? Explain why we use them, and give examples of functions that report a Boolean value.
- Show us the
traffic signal _
, letter grade _
, and state of water _
blocks.
- Explain the difference between a command and a reporter block.
- Show us the
is _ between _ and _ ?
block.
- Show us your number guessing game.
More Self-Check Questions
- Why do we use the
if
and if-else
blocks?
- When do you use a command block, and when do use use a reporter block?
Week 2: Labs 4 and 5
Lab 4: Functions
Required
- Name a few of the input types. Why is it important that we specify input types?
- How are global variables different from script variables?
- Show and Explain your Valid-Date Block
- Show and Explain your “sum of two smallest” block.
- Explain the bug(s) in “(Problem 3) Sum of numbers between x and y.”
More Self-Check Questions
- Why is the check block useful? And how does it work?
- Why is the broadcast block useful? Give an example of a good situation to use one.
Lab 5: Lists 1
Required
- What is a list? Why would we use a list of 10 elements instead of just making 10 variables?
- What do
map
, keep
, and combine
each do? What are their inputs and outputs? What are these types of functions called?
- Show us your
acronym
block.
- Show us your
expand _
block.
- What’s the difference between the
for each
loop and the for (i)
loop we’ve used in previous labs?
** More Self-Check Questions **
- Look back at the
swap items
block. Why do we need a “temp” variable?
- When would we want to use a loop versus a higher order function?
Week 3: Lab 6 and 7
Lab 6: Algorithms
Required
- What is an algorithm? Please give an example both in real life and from class.
- Please show both your “Find the number X in Unsorted List” and “Find the number X in Sorted List” blocks and describe the difference in the algorithms used.
- Are algorithms which are (on average) faster always “better”? Why or why not?
- What might some “trade-offs” to different computer science algorithms be?
- How can abstraction and algorithms relate in computer science?
More Self-Check Questions
- What is memoization? When is it useful?
- If you have an unsorted list, do you think it will be faster to use your “Find the number X in Unsorted List” block, or sort the list and use your “Find the number X in Sorted List”? Remember that sorting takes time.
Lab 7: Trees and Fractals Using Recursion
Required
- Please show me your “crazy-tree” block.
- Why is it important that the inputs to a recursive call be smaller than the original inputs to the function?
- Why is it important that the sprite face the same direction at the end of a recursive function as it faced initially?
- What defines a recursive block? What are the two necessary “cases” that a recursive block must consider? Name and define them.
- Please show me your “snowflake” block.
More Self-Check Questions
- Please shoe me your “C-Curve” block.
Week 4: Lab 8 and 9
Lab 8: Recursive Reporters
Required
- Why do we map the first item of the set in front of a recursive call of
subsets _
over the rest of the list?
- Explain why the second version of
subsets _
only makes 7 calls instead of 64.
- Explain how the
sort _
block works, how the merge _
block works, and how they work together.
- Show us the recursive
numbers _
block.
- Show us the recursive
ends-e _
block.
More Self-Check Questions
- Why might we want to write a function recursively instead of iteratively or using a HOF?
- How might we be able to use recursive reporters to improve runtime?
Lab 9: Besides Blocks: Welcome to Python
Required
- What is the difference between the “python”, “python file.py”, and “python -i file.py” terminal commands?
- What is the difference between the “print” and “return” python commands?
- Show your “reverse_string(string)” function. If you did it iteratively, explain the recursive solution. If you did it recursively, explain the iterative solution.
- Show your “palindrome(string)” function.
- Show your c-curve function and its output.
More Self-Check Questions
- What is the difference between the “=”, “!=”, and “==” python commands?
- What is the domain and range for the “+” function in python?
Week 5: Lab 10
Lab 10: Besides Blocks: Data Structures in Python
Required
- What is the difference between = and == in python?
- Show us the result of running the autograder.
- What is a directory?
- What does 0-indexing mean?
Self-Check Questions
- How to open the Python interpreter and run a script.
- How do you make a directory, enter a directory, and check what is inside your current directory?
- How do you define a function in python?