Prasnya
Prasnya
Continue with Google
Week 6 Computational Thinking Questions | Prasnya
Prasnya
Prasnya
Continue with Google
Computational Thinking > Week 6
All PYQs
Topic Wise PYQs
Start Weekly Test
Type:
All
Difficulty:
All
Year:
All
4Q
01
A company has collected some data (stored in Table 1) for promotion of their products. Every row in the table has information about the number of people willing to attend the promotion on Saturday and Sunday, respectively, in a given city. For example, take the first row. According to Fantabook, 20 and 30 people are willing to attend the promotion on Saturday and Sunday, respectively, in Chennai. The pseudocode below is used to process the data in this table. Which of the following is correct? ``` Procedure bestDay(Z) countSat = 0, countSun = 0 while(Table 1 has more rows) { Read the first row X from Table 1 if(X.City == Z) { countSat = countSat + X.Saturday countSun = countSun + X.Sunday } Move X to Table 2 } if(countSun > countSat) { return("Sunday") } return("Saturday") End bestDay ```
Single correct
MEDIUM
4 marks
29 October 2023
02
Consider the Table 2 created from the previous question. At the end of execution, what will the value of `countMax` and `occurMax` be? ``` countMax = 0, occurMax = "None" while(Table 2 has more rows) { count = 1 Read the first row Y from Table 2 Move Y to Table 4 while(Table 2 has more rows) { Read the first row Z from Table 2 if(Y.Word == Z.Word) { count = count + 1 Move Z to Table 4 } else { Move Z to Table 5 } } Move all the rows from Table 5 to Table 2 if(count >= countMax) { countMax = count occurMax = Y.Word } } ```
Comprehension
MEDIUM
4 marks
29 October 2023
03
Consider the Player dataset given below that keeps track of the runs scored by each player in the test matches held. The following pseudocode is executed using the "Player" dataset. A player can join a sports club if his runs are above 75 in Trial, TestSeries and WorldCup. The variables `A`, `B` and `C` store the number of players in GoldStriker, SilverStriker and BronzeStriker clubs respectively based on the execution of the pseudocode. Which club will be allotted to a player if he gets 167, 180, 180 runs in Trial, TestSeries and WorldCup respectively? ``` A = 0, B = 0, C = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Trial > 75 and X.TestSeries > 75 and X.WorldCup > 75){ match = maxMatch(X) if(match == "WorldCup"){ A = A + 1 } if(match == "TestSeries"){ B = B + 1 } if(match == "Trial"){ C = C + 1 } } Move X to Table 2 } Procedure maxMatch(Z) if(Z.Trial > Z.TestSeries){ if(Z.Trial > Z.WorldCup){ return("Trial") } else{ return("WorldCup") } } else{ if(Z.TestSeries > Z.WorldCup){ return("TestSeries") } else{ return("WorldCup") } } End maxMatch ```
Multiple correct
MEDIUM
4 marks
16 July 2023
04
The following pseudocode is executed using the dataset given. At the end of execution, `A`, `B`, `C` and `D` capture the number of pairs of users who have the same grade, reside in the same area but have different `YearOfRegistration`. Choose the correct code fragment to complete the pseudocode. ``` A = 0, B = 0, C = 0, D = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Units < 200){ Move X to Table 2 } if(X.Units >= 200 and X.Units <= 350){ Move X to Table 3 } if(X.Units > 350 and X.Units <= 550){ Move X to Table 4 } if(X.Units > 550){ Move X to Table 5 } } A = findPair(Table 2) B = findPair(Table 3) C = findPair(Table 4) D = findPair(Table 5) Procedure findPair(Table T) C = 0 while(Table T has more rows){ Read the first row X in Table T Move X to Table T1 while(Table T has more rows){ Read the first row Y in Table T Move Y to Table T2 ******** Statement 1 ******** } Move all rows from Table T2 to Table T } return(C) End findPair ```
Single correct
MEDIUM
3 marks
16 July 2023
Showing 4 questions.
Computational Thinking > Week 6
All PYQs
Topic Wise PYQs
Start Weekly Test
Type:
All
Difficulty:
All
Year:
All
4Q
01
A company has collected some data (stored in Table 1) for promotion of their products. Every row in the table has information about the number of people willing to attend the promotion on Saturday and Sunday, respectively, in a given city. For example, take the first row. According to Fantabook, 20 and 30 people are willing to attend the promotion on Saturday and Sunday, respectively, in Chennai. The pseudocode below is used to process the data in this table. Which of the following is correct? ``` Procedure bestDay(Z) countSat = 0, countSun = 0 while(Table 1 has more rows) { Read the first row X from Table 1 if(X.City == Z) { countSat = countSat + X.Saturday countSun = countSun + X.Sunday } Move X to Table 2 } if(countSun > countSat) { return("Sunday") } return("Saturday") End bestDay ```
Single correct
MEDIUM
4 marks
29 October 2023
02
Consider the Table 2 created from the previous question. At the end of execution, what will the value of `countMax` and `occurMax` be? ``` countMax = 0, occurMax = "None" while(Table 2 has more rows) { count = 1 Read the first row Y from Table 2 Move Y to Table 4 while(Table 2 has more rows) { Read the first row Z from Table 2 if(Y.Word == Z.Word) { count = count + 1 Move Z to Table 4 } else { Move Z to Table 5 } } Move all the rows from Table 5 to Table 2 if(count >= countMax) { countMax = count occurMax = Y.Word } } ```
Comprehension
MEDIUM
4 marks
29 October 2023
03
Consider the Player dataset given below that keeps track of the runs scored by each player in the test matches held. The following pseudocode is executed using the "Player" dataset. A player can join a sports club if his runs are above 75 in Trial, TestSeries and WorldCup. The variables `A`, `B` and `C` store the number of players in GoldStriker, SilverStriker and BronzeStriker clubs respectively based on the execution of the pseudocode. Which club will be allotted to a player if he gets 167, 180, 180 runs in Trial, TestSeries and WorldCup respectively? ``` A = 0, B = 0, C = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Trial > 75 and X.TestSeries > 75 and X.WorldCup > 75){ match = maxMatch(X) if(match == "WorldCup"){ A = A + 1 } if(match == "TestSeries"){ B = B + 1 } if(match == "Trial"){ C = C + 1 } } Move X to Table 2 } Procedure maxMatch(Z) if(Z.Trial > Z.TestSeries){ if(Z.Trial > Z.WorldCup){ return("Trial") } else{ return("WorldCup") } } else{ if(Z.TestSeries > Z.WorldCup){ return("TestSeries") } else{ return("WorldCup") } } End maxMatch ```
Multiple correct
MEDIUM
4 marks
16 July 2023
04
The following pseudocode is executed using the dataset given. At the end of execution, `A`, `B`, `C` and `D` capture the number of pairs of users who have the same grade, reside in the same area but have different `YearOfRegistration`. Choose the correct code fragment to complete the pseudocode. ``` A = 0, B = 0, C = 0, D = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Units < 200){ Move X to Table 2 } if(X.Units >= 200 and X.Units <= 350){ Move X to Table 3 } if(X.Units > 350 and X.Units <= 550){ Move X to Table 4 } if(X.Units > 550){ Move X to Table 5 } } A = findPair(Table 2) B = findPair(Table 3) C = findPair(Table 4) D = findPair(Table 5) Procedure findPair(Table T) C = 0 while(Table T has more rows){ Read the first row X in Table T Move X to Table T1 while(Table T has more rows){ Read the first row Y in Table T Move Y to Table T2 ******** Statement 1 ******** } Move all rows from Table T2 to Table T } return(C) End findPair ```
Single correct
MEDIUM
3 marks
16 July 2023
Showing 4 questions.