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

Databases, formulas and a vote table

الأسبوع 28 · المحور الرابع، الدرس ٥ «إنشاء قاعدة بيانات»: الحقول والسجلات والصيغ وعدّ الأصوات · 3 دروس
3

A vote table and the total

ICT P6 Term 2, Theme 4: pp. 58–61
GoalBuild and read a vote table, find the winner and total the votes with a formula.
New words
vote · a choice made by one person among severalsolution · an idea for solving a problemwinner · the choice with the most votessum · adding numbers together
Explanation

Databases are good for counting votes. Imagine a class must pick one of three solutions to keep the playground tidy: Solution A, Solution B and Solution C. Plan the table: the fields are ID, Class, Solution A, Solution B and Solution C. Each voter has one record. Write 1 in the column of the solution the voter chose, and leave the other columns empty. Use only invented voters with made-up IDs. Then total each column with a formula. To add the numbers in C2 to C9 you can write =C2+C3+C4+C5+C6+C7+C8+C9. Many programs also have a short word for adding a range, written like =SUM(C2:C9). The winner is the solution with the largest total. Check your work: the three totals added together must equal the number of voters. Data about real people, such as real votes with names, must be protected by law, so we use only invented data.

C10fx=C2+C3+C4+C5+C6+C7+C8+C9
ABCDE
1IDClassSolution ASolution BSolution C
22016A1
32026A1
42036A1
52046B1
62056B1
72066B1
82076C1
92086C1
10Total422
Worked examples
SolutionRows with a 1Votes
A2, 4, 6, 84
B3, 72
C5, 92
Reading the table. Count the 1s in column C: rows 2, 4, 6 and 8 have a 1, so Solution A has 1 + 1 + 1 + 1 = 4 votes. In column D rows 3 and 7 give 2 votes. In column E rows 5 and 9 give 2 votes.
The winner and the check. Solution A has the most votes (4), so it wins. Check: 4 + 2 + 2 = 8, and there were 8 voters, so the count is right.
SportVotes
football3
swimming1
tennis1
A class survey. A different invented table records favourite sports for 5 pupils: football 3, swimming 1, tennis 1. The formula for the football total is the sum of the three 1s: 1 + 1 + 1 = 3.
Class activity

Count the votes. Draw a vote table on squared paper with the fields ID, Class, Solution A, Solution B and Solution C. Invent ten voters (‘Student 1’ to ‘Student 10’) with made-up IDs and give each a vote by writing a 1. Write the formula that totals Solution A, work out the three totals, say which solution wins, and check that the totals add up to ten.

Practice
1
How do you record one vote in the table?
2
In the lesson table, how many votes did Solution A get?
3
Solution A has 3 votes, Solution B has 5 and Solution C has 1. How many votes in all?
4
How do you find the winner?