Q36.The following pseudocode is executed using the "Shopping Bills" dataset. At the end of execution, `A` captures the highest Price of an item purchased from "Big Bazaar". But the pseudocode may have mistakes in one or more lines. Identify all such lines (if any). Assume that all statements not listed in the options below are free of errors.
```
A = 0
while(Pile 1 has more cards) {
Read the top card X in Pile 1
if(X.ShopName == "Big Bazaar") {
temp = findItem(X)
if(temp > A) {
A = temp
}
}
Move X to Pile 2
}
Procedure findItem(Y)
maxPrice = 0
while(Card Y has more items) {
Read an item Z from ItemList of Card Y
if(maxPrice >= Z.Price) {
maxPrice = Z.Price
}
Remove Z from ItemList of Card Y
}
return(maxPrice)
End findItem
```
Save
Check
Details
Q36
29 Oct 2023
Q36.The following pseudocode is executed using the "Shopping Bills" dataset. At the end of execution, `A` captures the highest Price of an item purchased from "Big Bazaar". But the pseudocode may have mistakes in one or more lines. Identify all such lines (if any). Assume that all statements not listed in the options below are free of errors.
```
A = 0
while(Pile 1 has more cards) {
Read the top card X in Pile 1
if(X.ShopName == "Big Bazaar") {
temp = findItem(X)
if(temp > A) {
A = temp
}
}
Move X to Pile 2
}
Procedure findItem(Y)
maxPrice = 0
while(Card Y has more items) {
Read an item Z from ItemList of Card Y
if(maxPrice >= Z.Price) {
maxPrice = Z.Price
}
Remove Z from ItemList of Card Y
}
return(maxPrice)
End findItem
```