Lessons 63–64 · 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
64
Practical lesson
Textbook: p. 148
GoalDraws charts and coordinate pictures: shows survey results in a pie chart with Pie and writes numbers on the axes with TextOut.
New words
pie chart: a circle divided into sectors proportional to the parts · doiraviy diagrammaangle: the size of a sector in degrees · burchakshare: a part of the whole · ulushaxis label: the number or name written at an axis · o‘q yozuvi
Explanation
In the practical lesson survey results are shown in a pie chart. Results: football 6 votes, chess 3, swimming 3, 12 in all. The angle of each part is votes · 360 / total: football 6·360/12 = 180°, chess 90°, swimming 90°. The centre is (100, 100), the radius 80: the bounding rectangle (20, 20, 180, 180). The football sector goes counterclockwise 180° from east: Pie(20, 20, 180, 180, 180, 100, 20, 100); chess – from west to south: Pie(20, 20, 180, 180, 20, 100, 100, 180); swimming – from south to east: Pie(20, 20, 180, 180, 100, 180, 180, 100). Before each sector Brush.Color := clRed (clBlue, clYellow) is given, and the name of each part is written with TextOut. The second application draws coordinate axes and writes numbers at their marks with statements such as TextOut(20 * i, 105, IntToStr(i)). In the third application create a chart with your own data (for example pages read on each weekday).
Worked examples
Votes 6, 3, 3 (12 in all): the angles are 180°, 90°, 90°, with the sum 180+90+90 = 360. Shares: football 6/12 = 50%, chess and swimming 25% each. Radius 80, centre (100, 100): the rectangle (100–80, 100–80, 100+80, 100+80) = (20, 20, 180, 180).
Other results: 5, 3, 2, 2 (12 in all): the angles are 5·360/12 = 150°, 3·360/12 = 90°, 2·360/12 = 60°, 60°; the sum is 150+90+60+60 = 360. If the sum is not 360, there is a mistake in the calculation.
Class activity
“The chart workshop”: a group builds a chart from 4 invented results, checks that the angles add up to 360° and works out the points of the sectors.
Practice
1
The votes are 4, 4, 2, 2 (12 in all). What is the angle of the first part?
120
2
What is the sum of the angles of these four parts?
360
3
The centre is (150, 120) and the radius 90. What are the upper left and lower right corners of the bounding rectangle?
(60, 30) and (240, 210)
4
Why must the angles of a pie chart add up to 360°?
The sectors fill the whole circle; if the sum is different, the shares were calculated wrongly.