Q50.The following pseudocode is executed using the "Shopping Bills" dataset. At the end of execution, `A` captures the lowest 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)
minPrice = 0
while(Card Y has more items){
Read an item Z from ItemList of card Y
if(minPrice > Z.Price){
minPrice = Z.Price
}
Remove Z from ItemList of card Y
}
return(minPrice)
End findItem
```
Save
Check
Details
Q50
5 Jun 2022
Q50.The following pseudocode is executed using the "Shopping Bills" dataset. At the end of execution, `A` captures the lowest 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)
minPrice = 0
while(Card Y has more items){
Read an item Z from ItemList of card Y
if(minPrice > Z.Price){
minPrice = Z.Price
}
Remove Z from ItemList of card Y
}
return(minPrice)
End findItem
```