Q39Comprehension5 Marks7 Aug 2022
Passage
Based on the above data, answer the given subquestions. The following pseudocode constructs a matrix M from the "Shopping Bills" dataset. Two bills are said to be similar if the difference of their total bill amount is at most 100. Procedure abs(a) returns absolute value of input integer a. For example: abs(5) = 5, abs(-5) = 5.
```
D = {}
while(Table 1 has more rows){
Read the first row X in Table 1
D[X.SeqNo] = [X.Name, X.Total]
Move X to Table 2
}
n = length(keys(D))
M = createMatrix(n, n)
foreach i in keys(D){
foreach j in keys(D){
if(i != j and abs(last(D[i]) - last(D[j])) <= 100){
M[i][j] = 1
if(first(D[i]) == first(D[j])){
M[i][j] = M[i][j] + 1
}
}
}
}
```
Choose the correct statement(s) based on given pseudocode. It is a Multiple Select Question.
--- End of Question Paper (Part 2) ---