Lessons 6 · 1 lessons · M. R. Fayziyeva, D. M. Sayfurov, N. S. Xaytullayeva. Informatics and Information Technologies, Grade 9. “Nashriyot uyi Tasvir”, Tashkent, 2020
6
Stages of solving problems on a computer
Textbook: pp. 17–19
GoalLists the six stages of solving a problem on a computer in order and shows what is done at each stage of a simple problem.
New words
problem statement: stating the aim and finding the given and wanted quantities · masalaning qo‘yilishimathematical model: the problem written with formulas and relations · matematik modelgiven and result quantities: what we know and what we must find · boshlang‘ich va natijaviy kattaliklartesting: running the program on chosen values to check that it is right · testlash
Explanation
Solving a problem on a computer has six stages. 1) Problem statement: the aim is fixed, the given and result quantities are picked out and unnecessary data is put aside. 2) Mathematical model: the link between the quantities is written as a formula or equation. 3) Algorithm design: from the model, a sequence of actions is written in words or as a flowchart. 4) Programming: the algorithm is written in a programming language. 5) Entering the program into the computer’s memory. 6) Getting and analysing the result: the program is run, tested with different values, and mistakes are corrected. The clearer and fuller the problem statement, the easier the other stages are; the result is also always checked for common sense (for example, time must not come out negative).
Worked examples
Problem: a car travelled 180 km in 3 hours; what is its average speed? 1) Given: S = 180 km, t = 3 h; find: v. 2) Model: v = S / t. 3) Algorithm: input S and t; compute v = S / t; output v. 6) Result: v = 60 km/h – realistic and with the right unit.
Problem: Jasur drew a rectangle with sides 7 cm and 4 cm with a yellow marker. What is its area? The colour of the marker is unnecessary information. Model: S = a · b = 7 · 4 = 28 cm². The same works for the size of a text file: 25 pages × 38 lines × 64 characters = 60 800 characters ≈ 59 KB (1 character = 1 byte).
Class activity
“Chain of stages”: six cards carry the names of the stages. The cards are shuffled, students line up in the right order and say what is done at each stage.
Practice
1
List the six stages of problem solving in order.
Statement, mathematical model, algorithm design, programming, entering the program, getting and analysing the result.
2
1 kg of apples costs 12 000 so‘m. How much do 2.5 kg cost? Write the model and compute.
30000
3
Sardor rode a blue bicycle at 18 km/h for 2 hours. Which piece of information is unnecessary and how far did he go?
The colour (blue) is unnecessary; S = v · t = 18 · 2 = 36 km.
4
Why is the result analysed and tested with different values?
A wrong formula, a wrongly entered number or an unreasonable result (e.g. negative time) is found at this stage.