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

Term review and class-garden project

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

Term project: a plant-growth predictor, from plan to talk

ICT Prep 3 Term 1, Units 1–2: Review
GoalPlan a plant-growth predictor for a class garden on paper, from the four skills to a short talk.
New words
project · a bigger task that a group plans and finishesrole · the part each member of the group is responsible forlimit · the range in which a prediction can be trustedcredit · saying where help or ideas came from
Explanation

Your group will plan a plant-growth predictor for a class garden. Everything stays on paper. Start with the four skills in the table. The group measures one plant for four days: 10, 12, 14 and 16 cm (invented numbers). The pattern is a straight line with b = 10 and w = 2. The bars show it. The function predict_height(days) returns w * days + b; 3 days give 16 cm. A program must also check the typed number with try and except ValueError. Add a limit note: a plant stops growing, so the line is good only inside the days measured. For AI help, write a credit line and never type names, school or photos to an AI tool. Give each member a role: data collector, programmer, tester and speaker, then prepare a talk of a few minutes.

SkillFor the plant-growth predictor
Decompositioncollect data, find w and b, write the function, check the input, test
Pattern recognitiona straight-line rule: the same growth each day
Abstractionkeep days and height; ignore the pot colour and the weather
Algorithm designask days, check, compute, show
Worked examples
Startread days (text)whole number?yesnoheight = 2 * days + 10show heightshow: digits onlyEnd
The algorithm as a flowchart: read the days as text, check that it is a whole number, calculate the height with 2 × days + 10, and show it. If the text is not a whole number, show a hint instead.
051015200123cmheight in cm
The data and the bars show the pattern: the plant grows 2 cm each day from 10 cm. The limit note says that the line is good only for the measured days, because a real plant stops growing.
Python
1def predict_height(days):
2    w = 2
3    b = 10
4    return w * days + b
5
6try:
7    days = int(input("How many days? "))
8    print("Predicted height:", predict_height(days), "cm")
9except ValueError:
10    print("Please type digits only.")
Output
How many days? 3
Predicted height: 16 cm
The program: the function holds w = 2 and b = 10, and try and except ValueError protect the input. With 3 the screen shows 16 cm; the word three would show the hint instead.
Class activity

In your group, fill the plan on paper: the four skills, the flowchart, the data table with the bars, the function, the input check, the limit note, the credit line and the roles. Practise the talk twice and ask the listeners one question about the limit. Do not use any real name or photo.

Practice
1
What does predict_height(5) return?
2
Why do the bars grow by the same amount each day?
3
Why is the prediction for 60 days not trustworthy?
4
Write a credit line and say what must never be typed to an AI tool.