Lessons 41–42 · 2 lessons · N. I. Taylaqov (general editor), A. B. Akhmedov, M. D. Pardayeva, A. A. Abdug‘aniyev, U. M. Mirsanov. Informatics and Information Technologies, Grade 10, 1st edition. “Extremum-Press”, Tashkent, 2017
42
Test work
Textbook: p. 95
GoalCompletes a test variant on lessons 35–41 of the Delphi chapter: programming stages, parts of the environment, window properties, the button and ShowMessage.
New words
variant: one version of a test · varianttest calculation: working out the expected result before running · sinov hisobidebugging: finding and fixing a mistake in the code · xatoni topishchecklist: a list of things to verify before finishing · tekshiruv ro‘yxati
Explanation
In the test both theory and a practical task are checked. The theory part asks about the stages of programming, the parts of the Delphi interface and the menu sections. The practical part requires creating an application, setting window properties, writing a button procedure or building a limit condition. In each practical task first calculate the expected numbers by hand, then run with F9 and compare. If there is a mistake, first check whether the statements are between begin and end, whether the procedure belongs to the right button and whether strings are in single quotes. At the end save the application in a separate folder.
Worked examples
Sample: 1) Write the difference between assembler and high-level languages. 2) What is the Object Inspector for? 3) Make the window 350×200 and change its title to 'Test'. 4) When the button is pressed Height grows by 15, but if it exceeds 400 a message appears: if Form1.Height < 400 then Form1.Height := Form1.Height + 15 else ShowMessage('Limit');
Checking: if Height starts at 200 with a +15 step, after 13 clicks it is 200+13·15 = 395. 395 < 400 is true, so at the 14th click Height grows to 410 and the limit is slightly exceeded. Only at the 15th click does the message appear. To stop at exactly 400 the step must divide 200 (400–200).
Class activity
“Work on mistakes”: each student shows one mistake from the test to a partner, they correct the code together and confirm the right result by calculation.
Practice
1
At which stage were properties and methods given to objects?
Object-oriented programming
2
Height starts at 200 with +15 per click. What is Height after 5 clicks?
275
3
Is the condition Height < 400 true at Height = 395?
Yes, true
4
Why is the limit condition checked before the change is made?
If the condition is checked before the change, the window does not pass the limit.