Thinking like a computer
Answers are for parents and teachers.
1
Write the four skills of computational thinking and one everyday example for each.
Decomposition: splitting a trip into transport, food, money. Pattern recognition: every trip needs a list. Abstraction: a map without shops. Algorithm design: a recipe.
2
Put the five steps in order: test, write the code, understand the problem, write the steps, find the inputs and outputs.
Understand the problem, find the inputs and outputs, write the steps, write the code, test.
3
Look at the program in the picture. The user types 8 and 15. What does the screen show?
Python
1num1 = int(input("First number: ")) 2num2 = int(input("Second number: ")) 3total = num1 + num2 4print(total)
23.
4
A friend writes total = num1 + num2 but forgets int(). The user types 3 and 4. What shows, and how do you fix it?
It shows 34. Put int() around each input() so that the texts become numbers; then the screen shows 7.