☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Term review and class-garden project

الأسبوع 15 · مراجعة الوحدتين ١ و٢ ومشروع الفصل (من إعداد Darslab) · 3 دروس
1

Review: thinking, algorithms and Python basics

ICT Prep 3 Term 1, Units 1–2: Review
GoalReview computational thinking, algorithms, strings and lists with new mixed tasks.
New words
four skills · decomposition, pattern recognition, abstraction, algorithm designflowchart · a drawing of an algorithm with oval, rectangle, parallelogram and diamondindex · the position of a character or an item, counted from zeromutable · can be changed after it is made: a list yes, a string no
Explanation

Time to look back at Weeks 1 to 9 with tasks that are new. Remember the main points. The four skills of computational thinking come before the code. The five steps are: understand, inputs and outputs, steps, code, test. A flowchart uses the oval, the rectangle, the parallelogram and the diamond. Algorithms can be sequential, conditional or loops, and there are search and sort algorithms. In Python, = stores and == tests; range(1, 6) stops before 6; a string cannot be changed but a list can; an index starts at 0. The flowchart in the picture reads a number and answers Big or Small. Example 2 shows its code. Work through the examples first, then try the practice tasks without looking back.

Startread numnum > 10yesnoshow Bigshow SmallEnd
Worked examples
Everyday situationSkill
a pupil splits a poster project into text, pictures and coloursdecomposition
Mona sees that all her stories have a title, a hero and a problempattern recognition
a route map keeps roads and stops but not shop coloursabstraction
Nour writes numbered steps for building a modelalgorithm design
Task: match each everyday situation with one of the four skills. The answers are in the table: splitting a project is decomposition, noticing what stories share is pattern recognition, keeping only roads and stops is abstraction, numbered steps are algorithm design.
Python
1num = int(input("Enter a number: "))
2if num > 10:
3    print("Big")
4else:
5    print("Small")
Output
Enter a number: 12
Big
Task: read the flowchart and write the matching code. The diamond num > 10 becomes if num > 10:, the yes arrow becomes the indented print, and the no arrow becomes else:. When the user types 12, the screen shows Big.
Class activity

Write your own mixed review sheet with five tasks about Weeks 1 to 9: one matching task, one flowchart to code, one output to predict, one error to fix and one fixed-or-learned question. Swap it with a classmate and mark each other’s answers.

Practice
1
Predict the two lines shown.
Python
1text = "planet"
2print(text[1])
3print(text[-2])
2
Predict the list shown at the end.
Python
1numbers = [4, 8]
2numbers.append(6)
3numbers.remove(4)
4print(numbers)
3
A friend wants to show the numbers 1 to 6 with for i in range(1, 6): print(i), but only 1 to 5 appear. Fix it.
4
Which kind of algorithm is each: (a) show Hello four times; (b) if it is raining take an umbrella; (c) put the marks in order from small to large?