Q6Single correct5 Marks31 Aug 2025
The following pseudocode is executed using the "Scores" dataset. What will Z represent at the end of the execution?
```
D = {}
A = 0, C = 0
while(Table 1 has more rows){
Read the first row X in Table 1
A = A + X.Total
C = C + 1
if(isKey(D, X.Town/City)){
D[X.Town/City]["Total"] = D[X.Town/City]["Total"] + X.Total
D[X.Town/City]["Count"] = D[X.Town/City]["Count"] + 1
}
else{
D[X.Town/City] = {"Total": X.Total, "Count": 1}
}
Move X to Table 2
}
Avg = A / C
Z = 0
foreach B in keys(D){
city_avg = D[B]["Total"] / D[B]["Count"]
if(city_avg < Avg){
Z = Z + D[B]["Count"]
}
}
```