Prasnya
Prasnya
Prasnya
Continue with Google
Prasnya
Continue with Google
Week 2 Computational Thinking Questions | Prasnya
Computational Thinking > Week 2
All PYQs
Topic-Wise PYQs
Start Weekly Test
Mock tests
Week mock
Topic mock
Subject mock
Type:
All
Difficulty:
All
Year:
All
57Q
01
The following procedure is executed using the Shopping Bills dataset. Choose all the correct options given below. ``` sum = 0 count = 0 while (Pile 1 has more cards) { Read X from Pile 1 if (X.ShopName == "SV Stores" and X.TotalBillAmount < 400) { sum = sum + X.TotalBillAmount count = count + 1 } Move X to Pile 2 } ```
Multiple correct
MEDIUM
4 marks
15 March 2026
02
The following procedure finds the highest amount of bill generated at Sun General from the Shopping Bills dataset. But the programmer may have made mistakes in one or more steps. Identify all such steps (if any). Step 1. Arrange all cards in a single pile called Pile 1 Step 2. Maintain a variable max and initialize it to 0 Step 3. If Pile 1 is empty then stop the iteration Step 4. Read the top card in Pile 1 Step 5. If the shop name is Sun General and max > total bill amount then store total bill amount in max Step 6. Move the current card to another pile called Pile 2 and repeat from step 3
Single correct
MEDIUM
4 marks
15 March 2026
03
Consider the Olympics dataset. The following pseudocode is executed: ``` silver_count = 0 gender_check = 0 while(Table 1 has more rows){ Read X from Table 1 if(X.Medal == 'Silver' and X.Host_country == 'USA'){ silver_count = silver_count + 1 if(X.Gender == 'M'){ gender_check = gender_check + 1 } } Move X to Table 2 } ``` Which of the following must be true after execution?
Multiple correct
MEDIUM
5 marks
15 March 2026
04
The following pseudocode is executed using the "Words" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ flag1 = False flag2 = False Read the first row X in Table 1 if(X.PartOfSpeech != "Adjective"){ flag1 = True } if(X.LetterCount >= 3){ flag2 = True } if(flag1 and flag2){ count = count + 1 } Move X to Table 2 } ```
Single correct
EASY
4 marks
26 October 2025
05
The following pseudocode is executed using the "Scores" dataset. What will `A` represent at the end of the execution? ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 B = True if(X.Physics < X.Mathematics){ B = False } if(X.Mathematics < X.Chemistry){ B = False } if(X.Chemistry < X.Physics){ B = False } if(B == True){ A = A + 1 } Move X to Table 2 } ```
Single correct
MEDIUM
4 marks
26 October 2025
06
Consider the following pseudocodes executed on "Words" dataset. **Pseudocode 1:** ``` A = 0 B = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.PartOfSpeech == "Noun" ){ A = A + 1 if(X.LetterCount > 4){ B = B + 1 } } Move X to Table 2 } ``` **Pseudocode 2:** ``` A = 0 B = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.PartOfSpeech == "Noun" and X.LetterCount > 4){ B = B + 1 } A = A + 1 Move X to Table 2 } ``` Which of the following statement(s) is/are correct?
Multiple correct
MEDIUM
4 marks
26 October 2025
07
The following pseudocode is executed using the "Scores" dataset. ``` count1 = 0 count2 = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Gender == 'M' or X.Mathematics > X.Physics){ count1 = count1 + 1 } else{ count2 = count2 + 1 } Move X to Table 2 } ``` At the end of execution, which of the following statement(s) is/are correct?
Multiple correct
MEDIUM
4 marks
26 October 2025
08
The following pseudocode is executed using the Words dataset. What will `Count` represent at the end of execution? ``` A = 0, MinVowelRatio = 2 while(Table 1 has more rows){ Read the first row X from Table 1 Ratio = CountVowels(X) / X.LetterCount if(Ratio < MinVowelRatio){ MinVowelRatio = Ratio } Move X to Table 2 } Count = 0 while(Table 2 has more rows){ Read the first row X from Table 2 if(CountVowels(X) / X.LetterCount == MinVowelRatio){ if(X.Word ends with a full stop){ Count = Count + 1 } } Move X to Table 3 } Procedure CountVowels(Y) i = 1 B = 0 while(i <= Y.LetterCount){ if(ith letter of Y.Word is a vowel){ B = B + 1 } i = i + 1 } return(B) End CountVowels ```
Single correct
MEDIUM
5 marks
13 July 2025
09
The following pseudocode is executed using the "Words" dataset. ``` count = 0, flag = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(flag){ if(first letter of X.Word == 'm'){ if(2nd letter of X.Word == 'o'){ count = count + 1 } } } flag = False if(X.Word ends with full stop){ flag = True } } ``` What will `count` represent at the end of the execution? Assume that upper case and lower case are ignored during comparison of letters.
Single correct
MEDIUM
4 marks
13 July 2025
10
The following pseudocode is executed using the "Shopping Bills" dataset. At the end of execution, `A` captures the lowest price across all items purchased from "Big Bazaar". Choose the correct code fragment to complete the pseudocode. ``` A = 10000000 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) ********************** ****Fill the code**** ********************** End findItem ```
Multiple correct
MEDIUM
4 marks
13 July 2025
11
The following pseudocode is executed using the "Scores" dataset. ``` A = 0, B = 0 while(Table 1 has more rows){ Read the first row X from Table 1 if(X.Gender == 'M' and X.Total > 250){ A = A + 1 if(X.Total < 200){ B = B + 1 } } Move X to Table 2 } ``` Which of the following statements is/are correct?
Multiple correct
EASY
4 marks
13 July 2025
12
Consider the "Olympics" dataset. The following pseudocode is executed: ``` gold_count = 0 gender_check = 0 while(Olympics has more rows){ Read X from Olympics if(X.Medal == 'Silver' and X.Host_country != 'USA'){ silver_count = silver_count + 1 if(X.Gender == 'M'){ gender_check = gender_check + 1 } } Move X to History } ``` Which of the following must be true after execution?
Multiple correct
MEDIUM
4 marks
13 July 2025
13
Consider the procedure `mSum` as shown below. ``` Procedure mSum(X, Y, Z) Sum = 0 if(X <= Y and X <= Z){ Sum = Y + Z } else{ if(Y <= X and Y <= Z){ Sum = X + Z } else{ Sum = X + Y } } return(Sum) End mSum ``` What will the value of `mSum(5,7,7)` be?
Numerical
EASY
4 marks
13 July 2025
14
The following pseudocode is executed using the "Words" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ flag1 = False, flag2 = False Read the first row X in Table 1 if(X.PartOfSpeech == "Adverb"){ flag1 = True } if(X.LetterCount <= 5){ flag2 = True } if(flag1 and flag2){ count = count + 1 } Move X to Table 2 } ```
Single correct
EASY
4 marks
23 February 2025
15
At the end of the execution of the given procedure using the "Scores" dataset, what will A and B represent? ``` A = 100 B = 100 while(Table 1 has more cards){ Read top card X from Table 1 if(X.Physics <= A){ B = A A = X.Physics } else{ if(X.Physics <= B){ B = X.Physics } } Move card X to Table 2 } ```
Single correct
MEDIUM
4 marks
23 February 2025
16
The following pseudocode is executed using the "Scores" dataset. Which of the following statements is/are correct? ``` A = 0, B = 0 while(Table 1 has more rows){ Read the first row X from Table 1 flag = False if(X.Gender == 'F' and X.Total > 250){ flag = True } if(not flag){ A = A + 1 if(X.Total > 250){ B = B + 1 } } Move X to Table 2 } ```
Multiple correct
MEDIUM
5 marks
23 February 2025
17
The following pseudocode is executed using the "Shopping Bills" dataset. At the end of execution, `A` captures the lowest price across all items 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. It is a Multiple Select Question (MSQ). ``` 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 ```
Multiple correct
HARD
5 marks
23 February 2025
18
The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. "Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic." Assume that upper case and lower case are ignored during comparison of letters. Which of the following words will not be considered in the count at the end of execution? ``` count = 0, flag = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(1st letter of X.Word == 's' and flag){ if(2nd letter of X.Word == 'u'){ count = count + 1 } } if(X.Word ends with full stop){ flag = True } } ```
Multiple correct
MEDIUM
5 marks
23 February 2025
19
The given pseudocode is executed using the "Scores" dataset. There is a hypothesis that if a student performs well overall (i.e., scores at least total 180 marks), then he/she must have performed well in all the subjects (i.e., scored at least 60 marks in each subject). At the end of execution, `fracTrue` stores the fraction of students who satisfy this hypothesis. Choose the correct code fragment to complete the pseudocode. ``` countOverall = 0, countPerSub = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Total >= 180) { ******************** * Fill the code * ******************** } Move X to Table 2 } fracTrue = countPerSub / countOverall ```
Multiple correct
MEDIUM
5 marks
23 February 2025
20
The following pseudocode is executed using the "Words" dataset. What will `Count` represent at the end of execution? ``` A = 0, Flag = True while(Table 1 has more cards){ Read the first row X from Table 1 if(X.LetterCount > A){ A = X.LetterCount } Move X to Table 2 } B = 0, Count = 0 while(Table 2 has more cards){ Read the first row X from Table 2 if(X.LetterCount == A){ B = B + 1 } if(X.Word ends with a full stop and B >= 2){ Count = Count + 1 B = 0 } Move X to Table 3 } ```
Single correct
MEDIUM
4 marks
27 October 2024
21
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` captures the maximum letter count of a word which is not noun. Choose the correct code fragment to complete the pseudocode. ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 ******************** * Fill the code * ******************** Move X to Table 2 } ```
Single correct
EASY
4 marks
27 October 2024
22
The following pseudocode is executed using the "Scores" dataset. What will `count` represent at the end of the execution of pseudocode? ``` count = 0 while(Pile 1 has more cards){ Read the top card X from Pile 1 C = 0 if(X.Mathematics < 75){ C = C + 1 } if(X.Physics < 75){ C = C + 1 } if(X.Chemistry < 75){ C = C + 1 } if(C == 1){ count = count + 1 } Move X to Pile 2 } ```
Single correct
EASY
4 marks
27 October 2024
23
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `A` captures the lowest Chemistry marks scored by a male student from Vellore. Choose the correct code fragment(s) to complete the pseudocode. ``` A = 101 while(Table 1 has more rows){ Read the first row X in Table 1 ******************** * Fill the code * ******************** Move X to Table 2 } ```
Multiple correct
MEDIUM
5 marks
27 October 2024
24
The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. "Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic." What would be the value of `count` at the end of the execution of the above pseudocode? Assume that upper case and lower case are ignored during comparison of letters. ``` count = 0, flag = True while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(1st letter of X.Word == 's' and flag){ if(2nd letter of X.Word == 'o'){ count = count + 1 } } if(X.Word ends with full stop){ flag = False } } ```
Numerical
MEDIUM
4 marks
27 October 2024
25
The given pseudocode is executed using "Scores" dataset. Let `B` be a positive integer. What does the procedure `DoSomething` compute? ``` Procedure DoSomething(B) C = 0, D = 101 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Physics > C){ C = X.Physics } if(X.Chemistry < D){ D = X.Chemistry } Move X to Table 2 } if(C - D >= B){ return(False) } else{ return(True) } End DoSomething ```
Single correct
MEDIUM
4 marks
07 July 2024
26
Consider the procedure `mSum` as shown below. What will be the value of `mSum(4,4,2)`? ``` Procedure mSum(A, B, C) Sum = 0 if(A >= C and A >= B){ Sum = B + C } else{ if(B >= C and B >= A){ Sum = A + C } else{ Sum = A + B } } return(Sum) End mSum ```
Numerical
EASY
3 marks
07 July 2024
27
The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. "Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic." What would be the value of `count` at the end of the execution of the above pseudocode? Assume that upper case and lower case are ignored during comparison of letters. ``` count = 0, flag = True while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(flag){ if(1st letter of X.Word == 's'){ if(2nd letter of X.Word == 'u'){ count = count + 1 } } } if(X.Word ends with full stop){ flag = False } } ```
Numerical
MEDIUM
5 marks
07 July 2024
28
The following pseudocode is executed using the "Scores" dataset. At the end of the execution of the below pseudocode, if `count2` represents the number of male students whose Physics marks are less than or equal to Mathematics marks, then select the correct code fragment for `A` and `B`. ``` count1 = 0, count2 = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(....A.... or ....B....){ count1 = count1 + 1 } else{ count2 = count2 + 1 } Move X to Table 2 } ```
Single correct
MEDIUM
3 marks
25 February 2024
29
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, variable `Count` captures the number of students whose total marks are more than the class average of total marks but have scored below the subject average in at least one subject. Assume that `AvgT`, `AvgP`, `AvgC` and `AvgM` hold the average total, Physics, Chemistry and Mathematics marks respectively. Choose the correct code fragment to complete the pseudocode. ``` Count = 0 while(Table 1 has more rows){ Read the first row X from Table 1 A = False, B = False, C = False, D = False if(X.Total > AvgT){ A = True } if(X.Mathematics < AvgM){ B = True } if(X.Physics < AvgP){ C = True } if(X.Chemistry < AvgC){ D = True } ******************** * Fill the code * ******************** Move X to Table 2 } ```
Single correct
MEDIUM
4 marks
25 February 2024
30
Procedure `miniSum` accepts three numbers as parameters and returns the sum of two smallest numbers. Choose the correct code fragment to complete the procedure. ``` Procedure miniSum(A, B, C) Sum = 0 if(A > C and A > B){ Sum = B + C } ******************** * Fill the code * ******************** return(Sum) End miniSum ```
Single correct
MEDIUM
4 marks
25 February 2024
31
The following pseudocode is executed using the "Olympics" dataset. Procedure `doSomething` accepts a table of rows which contains rows of the same player. Assume that the player has won at least two medals and only one medal in any year. What will `(B - A)` represent at the end of the execution? ``` Procedure doSomething(Table T1) A = 2030, B = 2030 while(Table T1 has more rows){ Read the first row Z from Table T1 if(Z.Year < A){ B = A A = Z.Year } if(Z.Year > A and Z.Year < B){ B = Z.Year } Move the row Z to Table T2 } return((B - A)) End doSomething ```
Single correct
MEDIUM
4 marks
25 February 2024
32
miniSum accepts three numbers as parameters and returns the sum of two least parameters. Choose the correct code fragment to complete the procedure. ``` Procedure miniSum(A, B, C) Sum = 0 if(A > C and A > B) { Sum = B + C } ******************** * Fill the code * ******************** return(Sum) End miniSum ```
Single correct
MEDIUM
4 marks
29 October 2023
33
What will `Count` represent at the end of execution? The following pseudocode is executed using the "Words" dataset. ``` Count = 0 while(Table 1 has more rows) { Read the first row X from Table 1 Move X to Table 2 Letter = "i", C = 0 i = 1, A = False while(i <= X.LetterCount) { if(ith letter of X.Word is a vowel) { if(A and Letter == ith letter of X.Word) { C = 1 } Letter = ith letter of X.Word A = True } else { A = False } i = i + 1 } if(C == 1) { Count = Count + 1 } } ```
Single correct
MEDIUM
4 marks
29 October 2023
34
Swara has used a variable `max` to find the maximum total score using the "Scores" dataset. There are many ways to initialize `max`; choose the correct option(s).
Multiple correct
EASY
2 marks
29 October 2023
35
The given pseudocode is executed using the "Scores" dataset. There is a hypothesis that if a student performs well overall (i.e., scores at least 180 marks), then he/she must have performed well in all the subjects (i.e., scored at least 60 marks in each subject). At the end of execution, `fracTrue` stores the fraction of students who satisfy this hypothesis. Choose the correct code fragment(s). ``` countOverall = 0, countPerSub = 0 while(Table 1 has more rows) { Read the first row X from Table 1 if(X.Total > 180) { ******************** * Fill the code * ******************** } Move X to Table 2 } fracTrue = countPerSub / countOverall ```
Multiple correct
MEDIUM
4 marks
29 October 2023
36
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 ```
Multiple correct
MEDIUM
4 marks
29 October 2023
37
Choose the set of correct words in Table 2.
Comprehension
EASY
3 marks
29 October 2023
38
What will procedure `doSomething` return?
Comprehension
MEDIUM
4 marks
29 October 2023
39
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `A` captures the lowest Chemistry marks scored by a male student from Vellore. Choose the correct code fragment(s) to complete the pseudocode. ``` A = 101 while(Table 1 has more rows){ Read the first row X in Table 1 **** Fill the code **** Move X to Table 2 } ```
Multiple correct
MEDIUM
4 marks
16 July 2023
40
The following pseudocode is executed using the "Olympics" dataset. At the end of the execution, `A` stores the number of players who are either female from India or have won the match hosted by Australia in the year 2006, or both. The pseudocode may have mistakes. Identify all such mistakes, if any. Assume that all statements not listed in the options below are free of errors. ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 C = False, D = False if(X.Gender == "F" and X.HostCountry == "Australia"){ C = True } if(X.Year == 2006 and X.Nationality == "India"){ D = True } if(C or D){ A = A + 1 } Move X to Table 2 } ```
Multiple correct
MEDIUM
4 marks
16 July 2023
41
What would be the value of `s` at the end of the execution of the following pseudocode if the value of `n` is 1024? The operator `//` returns the quotient and the operator `%` returns the remainder. ``` s = 0, r = 0, n = 1024 while(n > 0){ r = n % 10 s = s + r n = n // 10 } ```
Numerical
EASY
4 marks
16 July 2023
42
Let `unit` be the number of units consumed by the consumer and `cost` be the amount of the bill to be paid. Choose the correct implementation to compute the cost.
Comprehension
EASY
3 marks
16 July 2023
43
The following pseudocode is executed using the "Words" dataset. What will `count` represent at the end of the execution? ``` count = 0, Flag = False while(Table 1 has more rows){ Read the first row X in Table 1 if(X.PartOfSpeech == "Noun"){ Flag = True } else{ if(Flag and X.PartOfSpeech == "Verb"){ count = count + 1 } } Move X to Table 2 } ```
Single correct
MEDIUM
3 marks
16 October 2022
44
Sripriya has used a variable `min` to find the minimum total score using the "Scores" dataset. There are many ways of initializing `min`. Choose the correct option(s) regarding the initialization of `min`.
Multiple correct
EASY
3 marks
16 October 2022
45
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of boys who scored at least 75 marks in Chemistry. Choose the correct code fragment(s) to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 ******** Fill the code ******** Move X to Table 2 } ```
Multiple correct
MEDIUM
4 marks
16 October 2022
46
The following pseudocode is executed using the "Library" dataset. Assume that Table 1 contains all the books authored by "Narayan" only. Also assume that the `Year` field of each book is distinct in the Table. Which of the following statement(s) are correct at the end of execution of this pseudocode? ``` Procedure groupBooks(Table 1) A = 2023, B = 0 while(Table 1 has more rows){ Read the first row Z from Table 1 if(Z.Year < A){ A = Z.Year B = Z.SeqNo } Move Z to Table 2 } while(Table 2 has more rows){ Read the first row X from Table 2 if(X.SeqNo == B){ Move X to Table 3 } else{ Move X to Table 4 } } End groupBooks ```
Multiple correct
MEDIUM
4 marks
16 October 2022
47
The following pseudocode is executed using the "Olympics" dataset. Procedure `doSomething` accepts a Table of rows which contains rows of the same player. Assume that every player has won at least two medals and only one medal in any year. What will `(B - A)` represent at the end of the execution? ``` Procedure doSomething(Table T1) A = 0, B = 0 while(Table T1 has more rows){ Read the first row Z from Table T1 if(Z.Year > A){ B = A A = Z.Year } if(Z.Year < A and Z.Year > B){ B = Z.Year } Move the row Z to Table T2 } return(A - B) End doSomething ```
Comprehension
MEDIUM
4 marks
16 October 2022
48
Kavya used a variable `miniBillTotal` to find the minimum total bill amount using the "Shopping Bills" dataset. There are many ways to initialize `miniBillTotal`. Choose the correct option(s).
Multiple correct
EASY
4 marks
05 June 2022
49
The following pseudocode is executed using the "Library" dataset. At the end of the execution, `N` captures the name of a book written in a language other than English with the maximum number of pages, and `A` captures the number of pages in the book. ``` A = 0, N = "None" while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Language != "English" and X.Pages > A){ A = X.Pages N = X.Name } Move X to Table 2 } ``` Assume that the rows of the table are shuffled in any random order. Choose the correct option(s).
Multiple correct
MEDIUM
4 marks
05 June 2022
50
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 ```
Multiple correct
HARD
4 marks
05 June 2022
51
The following pseudocode is executed using the "Scores" dataset. What will `A` represent at the end of the execution? ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Gender == "M" and X.CityTown == "Chennai"){ A = A + X.Mathematics } Move X to Table 2 } ```
Single correct
EASY
2 marks
05 June 2022
52
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` captures the maximum letter count among words that are not nouns. Choose the correct code fragment to complete the pseudocode. ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 *************** * Fill the code * *************** Move X to Table 2 } ```
Single correct
EASY
2 marks
05 June 2022
53
Let `X` be a row in the "Words" table. Let `isShortVerb` be a procedure to find whether the word in row `X` is a verb with letter count at most five. Choose the correct code fragment to complete the pseudocode. ``` Procedure isShortVerb(X) ******************** * Fill the code * ******************** End isShortVerb ```
Single correct
EASY
3 marks
05 June 2022
54
The following pseudocode is executed using the "Scores" dataset. What will `A` represent at the end of the execution? ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 B = True if(X.Physics >= 70){ B = False } if(X.Chemistry >= 70){ B = False } if(X.Mathematics >= 70){ B = False } if(B){ A = A + 1 } Move X to Table 2 } ```
Single correct
MEDIUM
3 marks
05 June 2022
55
The given pseudocode is executed using the "Scores" dataset. There is a hypothesis that if a student performs well overall, i.e. scores at least total 180 marks, then the student must have performed well in all the subjects, i.e. scored at least 60 marks in each subject. At the end of execution, `fracTrue` stores the fraction of students who satisfy this hypothesis. Choose the correct code fragment to complete the pseudocode. ``` countOverall = 0, countPerSub = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Total >= 180){ ************************** * Fill the code * ************************** } Move X to Table 2 } fracTrue = countPerSub / countOverall ```
Single correct
MEDIUM
3 marks
05 June 2022
56
`miniSum` accepts three distinct numbers as parameters and returns the sum of two smallest numbers. Choose the correct code fragment to complete the procedure. ``` Procedure miniSum(A, B, C) Sum = 0 if(A > C and A > B){ Sum = B + C } ******************** * Fill the code * ******************** return(Sum) End miniSum ```
Single correct
MEDIUM
4 marks
10 July 2022
57
What will procedure `doSomething` return?
Comprehension
MEDIUM
4 marks
10 July 2022
Showing 57 questions.
Computational Thinking > Week 2
All PYQs
Topic-Wise PYQs
Start Weekly Test
Mock tests
Week mock
Topic mock
Subject mock
Type:
All
Difficulty:
All
Year:
All
57Q
01
The following procedure is executed using the Shopping Bills dataset. Choose all the correct options given below. ``` sum = 0 count = 0 while (Pile 1 has more cards) { Read X from Pile 1 if (X.ShopName == "SV Stores" and X.TotalBillAmount < 400) { sum = sum + X.TotalBillAmount count = count + 1 } Move X to Pile 2 } ```
Multiple correct
MEDIUM
4 marks
15 March 2026
02
The following procedure finds the highest amount of bill generated at Sun General from the Shopping Bills dataset. But the programmer may have made mistakes in one or more steps. Identify all such steps (if any). Step 1. Arrange all cards in a single pile called Pile 1 Step 2. Maintain a variable max and initialize it to 0 Step 3. If Pile 1 is empty then stop the iteration Step 4. Read the top card in Pile 1 Step 5. If the shop name is Sun General and max > total bill amount then store total bill amount in max Step 6. Move the current card to another pile called Pile 2 and repeat from step 3
Single correct
MEDIUM
4 marks
15 March 2026
03
Consider the Olympics dataset. The following pseudocode is executed: ``` silver_count = 0 gender_check = 0 while(Table 1 has more rows){ Read X from Table 1 if(X.Medal == 'Silver' and X.Host_country == 'USA'){ silver_count = silver_count + 1 if(X.Gender == 'M'){ gender_check = gender_check + 1 } } Move X to Table 2 } ``` Which of the following must be true after execution?
Multiple correct
MEDIUM
5 marks
15 March 2026
04
The following pseudocode is executed using the "Words" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ flag1 = False flag2 = False Read the first row X in Table 1 if(X.PartOfSpeech != "Adjective"){ flag1 = True } if(X.LetterCount >= 3){ flag2 = True } if(flag1 and flag2){ count = count + 1 } Move X to Table 2 } ```
Single correct
EASY
4 marks
26 October 2025
05
The following pseudocode is executed using the "Scores" dataset. What will `A` represent at the end of the execution? ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 B = True if(X.Physics < X.Mathematics){ B = False } if(X.Mathematics < X.Chemistry){ B = False } if(X.Chemistry < X.Physics){ B = False } if(B == True){ A = A + 1 } Move X to Table 2 } ```
Single correct
MEDIUM
4 marks
26 October 2025
06
Consider the following pseudocodes executed on "Words" dataset. **Pseudocode 1:** ``` A = 0 B = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.PartOfSpeech == "Noun" ){ A = A + 1 if(X.LetterCount > 4){ B = B + 1 } } Move X to Table 2 } ``` **Pseudocode 2:** ``` A = 0 B = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.PartOfSpeech == "Noun" and X.LetterCount > 4){ B = B + 1 } A = A + 1 Move X to Table 2 } ``` Which of the following statement(s) is/are correct?
Multiple correct
MEDIUM
4 marks
26 October 2025
07
The following pseudocode is executed using the "Scores" dataset. ``` count1 = 0 count2 = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Gender == 'M' or X.Mathematics > X.Physics){ count1 = count1 + 1 } else{ count2 = count2 + 1 } Move X to Table 2 } ``` At the end of execution, which of the following statement(s) is/are correct?
Multiple correct
MEDIUM
4 marks
26 October 2025
08
The following pseudocode is executed using the Words dataset. What will `Count` represent at the end of execution? ``` A = 0, MinVowelRatio = 2 while(Table 1 has more rows){ Read the first row X from Table 1 Ratio = CountVowels(X) / X.LetterCount if(Ratio < MinVowelRatio){ MinVowelRatio = Ratio } Move X to Table 2 } Count = 0 while(Table 2 has more rows){ Read the first row X from Table 2 if(CountVowels(X) / X.LetterCount == MinVowelRatio){ if(X.Word ends with a full stop){ Count = Count + 1 } } Move X to Table 3 } Procedure CountVowels(Y) i = 1 B = 0 while(i <= Y.LetterCount){ if(ith letter of Y.Word is a vowel){ B = B + 1 } i = i + 1 } return(B) End CountVowels ```
Single correct
MEDIUM
5 marks
13 July 2025
09
The following pseudocode is executed using the "Words" dataset. ``` count = 0, flag = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(flag){ if(first letter of X.Word == 'm'){ if(2nd letter of X.Word == 'o'){ count = count + 1 } } } flag = False if(X.Word ends with full stop){ flag = True } } ``` What will `count` represent at the end of the execution? Assume that upper case and lower case are ignored during comparison of letters.
Single correct
MEDIUM
4 marks
13 July 2025
10
The following pseudocode is executed using the "Shopping Bills" dataset. At the end of execution, `A` captures the lowest price across all items purchased from "Big Bazaar". Choose the correct code fragment to complete the pseudocode. ``` A = 10000000 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) ********************** ****Fill the code**** ********************** End findItem ```
Multiple correct
MEDIUM
4 marks
13 July 2025
11
The following pseudocode is executed using the "Scores" dataset. ``` A = 0, B = 0 while(Table 1 has more rows){ Read the first row X from Table 1 if(X.Gender == 'M' and X.Total > 250){ A = A + 1 if(X.Total < 200){ B = B + 1 } } Move X to Table 2 } ``` Which of the following statements is/are correct?
Multiple correct
EASY
4 marks
13 July 2025
12
Consider the "Olympics" dataset. The following pseudocode is executed: ``` gold_count = 0 gender_check = 0 while(Olympics has more rows){ Read X from Olympics if(X.Medal == 'Silver' and X.Host_country != 'USA'){ silver_count = silver_count + 1 if(X.Gender == 'M'){ gender_check = gender_check + 1 } } Move X to History } ``` Which of the following must be true after execution?
Multiple correct
MEDIUM
4 marks
13 July 2025
13
Consider the procedure `mSum` as shown below. ``` Procedure mSum(X, Y, Z) Sum = 0 if(X <= Y and X <= Z){ Sum = Y + Z } else{ if(Y <= X and Y <= Z){ Sum = X + Z } else{ Sum = X + Y } } return(Sum) End mSum ``` What will the value of `mSum(5,7,7)` be?
Numerical
EASY
4 marks
13 July 2025
14
The following pseudocode is executed using the "Words" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ flag1 = False, flag2 = False Read the first row X in Table 1 if(X.PartOfSpeech == "Adverb"){ flag1 = True } if(X.LetterCount <= 5){ flag2 = True } if(flag1 and flag2){ count = count + 1 } Move X to Table 2 } ```
Single correct
EASY
4 marks
23 February 2025
15
At the end of the execution of the given procedure using the "Scores" dataset, what will A and B represent? ``` A = 100 B = 100 while(Table 1 has more cards){ Read top card X from Table 1 if(X.Physics <= A){ B = A A = X.Physics } else{ if(X.Physics <= B){ B = X.Physics } } Move card X to Table 2 } ```
Single correct
MEDIUM
4 marks
23 February 2025
16
The following pseudocode is executed using the "Scores" dataset. Which of the following statements is/are correct? ``` A = 0, B = 0 while(Table 1 has more rows){ Read the first row X from Table 1 flag = False if(X.Gender == 'F' and X.Total > 250){ flag = True } if(not flag){ A = A + 1 if(X.Total > 250){ B = B + 1 } } Move X to Table 2 } ```
Multiple correct
MEDIUM
5 marks
23 February 2025
17
The following pseudocode is executed using the "Shopping Bills" dataset. At the end of execution, `A` captures the lowest price across all items 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. It is a Multiple Select Question (MSQ). ``` 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 ```
Multiple correct
HARD
5 marks
23 February 2025
18
The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. "Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic." Assume that upper case and lower case are ignored during comparison of letters. Which of the following words will not be considered in the count at the end of execution? ``` count = 0, flag = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(1st letter of X.Word == 's' and flag){ if(2nd letter of X.Word == 'u'){ count = count + 1 } } if(X.Word ends with full stop){ flag = True } } ```
Multiple correct
MEDIUM
5 marks
23 February 2025
19
The given pseudocode is executed using the "Scores" dataset. There is a hypothesis that if a student performs well overall (i.e., scores at least total 180 marks), then he/she must have performed well in all the subjects (i.e., scored at least 60 marks in each subject). At the end of execution, `fracTrue` stores the fraction of students who satisfy this hypothesis. Choose the correct code fragment to complete the pseudocode. ``` countOverall = 0, countPerSub = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Total >= 180) { ******************** * Fill the code * ******************** } Move X to Table 2 } fracTrue = countPerSub / countOverall ```
Multiple correct
MEDIUM
5 marks
23 February 2025
20
The following pseudocode is executed using the "Words" dataset. What will `Count` represent at the end of execution? ``` A = 0, Flag = True while(Table 1 has more cards){ Read the first row X from Table 1 if(X.LetterCount > A){ A = X.LetterCount } Move X to Table 2 } B = 0, Count = 0 while(Table 2 has more cards){ Read the first row X from Table 2 if(X.LetterCount == A){ B = B + 1 } if(X.Word ends with a full stop and B >= 2){ Count = Count + 1 B = 0 } Move X to Table 3 } ```
Single correct
MEDIUM
4 marks
27 October 2024
21
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` captures the maximum letter count of a word which is not noun. Choose the correct code fragment to complete the pseudocode. ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 ******************** * Fill the code * ******************** Move X to Table 2 } ```
Single correct
EASY
4 marks
27 October 2024
22
The following pseudocode is executed using the "Scores" dataset. What will `count` represent at the end of the execution of pseudocode? ``` count = 0 while(Pile 1 has more cards){ Read the top card X from Pile 1 C = 0 if(X.Mathematics < 75){ C = C + 1 } if(X.Physics < 75){ C = C + 1 } if(X.Chemistry < 75){ C = C + 1 } if(C == 1){ count = count + 1 } Move X to Pile 2 } ```
Single correct
EASY
4 marks
27 October 2024
23
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `A` captures the lowest Chemistry marks scored by a male student from Vellore. Choose the correct code fragment(s) to complete the pseudocode. ``` A = 101 while(Table 1 has more rows){ Read the first row X in Table 1 ******************** * Fill the code * ******************** Move X to Table 2 } ```
Multiple correct
MEDIUM
5 marks
27 October 2024
24
The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. "Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic." What would be the value of `count` at the end of the execution of the above pseudocode? Assume that upper case and lower case are ignored during comparison of letters. ``` count = 0, flag = True while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(1st letter of X.Word == 's' and flag){ if(2nd letter of X.Word == 'o'){ count = count + 1 } } if(X.Word ends with full stop){ flag = False } } ```
Numerical
MEDIUM
4 marks
27 October 2024
25
The given pseudocode is executed using "Scores" dataset. Let `B` be a positive integer. What does the procedure `DoSomething` compute? ``` Procedure DoSomething(B) C = 0, D = 101 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Physics > C){ C = X.Physics } if(X.Chemistry < D){ D = X.Chemistry } Move X to Table 2 } if(C - D >= B){ return(False) } else{ return(True) } End DoSomething ```
Single correct
MEDIUM
4 marks
07 July 2024
26
Consider the procedure `mSum` as shown below. What will be the value of `mSum(4,4,2)`? ``` Procedure mSum(A, B, C) Sum = 0 if(A >= C and A >= B){ Sum = B + C } else{ if(B >= C and B >= A){ Sum = A + C } else{ Sum = A + B } } return(Sum) End mSum ```
Numerical
EASY
3 marks
07 July 2024
27
The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. "Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic." What would be the value of `count` at the end of the execution of the above pseudocode? Assume that upper case and lower case are ignored during comparison of letters. ``` count = 0, flag = True while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(flag){ if(1st letter of X.Word == 's'){ if(2nd letter of X.Word == 'u'){ count = count + 1 } } } if(X.Word ends with full stop){ flag = False } } ```
Numerical
MEDIUM
5 marks
07 July 2024
28
The following pseudocode is executed using the "Scores" dataset. At the end of the execution of the below pseudocode, if `count2` represents the number of male students whose Physics marks are less than or equal to Mathematics marks, then select the correct code fragment for `A` and `B`. ``` count1 = 0, count2 = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(....A.... or ....B....){ count1 = count1 + 1 } else{ count2 = count2 + 1 } Move X to Table 2 } ```
Single correct
MEDIUM
3 marks
25 February 2024
29
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, variable `Count` captures the number of students whose total marks are more than the class average of total marks but have scored below the subject average in at least one subject. Assume that `AvgT`, `AvgP`, `AvgC` and `AvgM` hold the average total, Physics, Chemistry and Mathematics marks respectively. Choose the correct code fragment to complete the pseudocode. ``` Count = 0 while(Table 1 has more rows){ Read the first row X from Table 1 A = False, B = False, C = False, D = False if(X.Total > AvgT){ A = True } if(X.Mathematics < AvgM){ B = True } if(X.Physics < AvgP){ C = True } if(X.Chemistry < AvgC){ D = True } ******************** * Fill the code * ******************** Move X to Table 2 } ```
Single correct
MEDIUM
4 marks
25 February 2024
30
Procedure `miniSum` accepts three numbers as parameters and returns the sum of two smallest numbers. Choose the correct code fragment to complete the procedure. ``` Procedure miniSum(A, B, C) Sum = 0 if(A > C and A > B){ Sum = B + C } ******************** * Fill the code * ******************** return(Sum) End miniSum ```
Single correct
MEDIUM
4 marks
25 February 2024
31
The following pseudocode is executed using the "Olympics" dataset. Procedure `doSomething` accepts a table of rows which contains rows of the same player. Assume that the player has won at least two medals and only one medal in any year. What will `(B - A)` represent at the end of the execution? ``` Procedure doSomething(Table T1) A = 2030, B = 2030 while(Table T1 has more rows){ Read the first row Z from Table T1 if(Z.Year < A){ B = A A = Z.Year } if(Z.Year > A and Z.Year < B){ B = Z.Year } Move the row Z to Table T2 } return((B - A)) End doSomething ```
Single correct
MEDIUM
4 marks
25 February 2024
32
miniSum accepts three numbers as parameters and returns the sum of two least parameters. Choose the correct code fragment to complete the procedure. ``` Procedure miniSum(A, B, C) Sum = 0 if(A > C and A > B) { Sum = B + C } ******************** * Fill the code * ******************** return(Sum) End miniSum ```
Single correct
MEDIUM
4 marks
29 October 2023
33
What will `Count` represent at the end of execution? The following pseudocode is executed using the "Words" dataset. ``` Count = 0 while(Table 1 has more rows) { Read the first row X from Table 1 Move X to Table 2 Letter = "i", C = 0 i = 1, A = False while(i <= X.LetterCount) { if(ith letter of X.Word is a vowel) { if(A and Letter == ith letter of X.Word) { C = 1 } Letter = ith letter of X.Word A = True } else { A = False } i = i + 1 } if(C == 1) { Count = Count + 1 } } ```
Single correct
MEDIUM
4 marks
29 October 2023
34
Swara has used a variable `max` to find the maximum total score using the "Scores" dataset. There are many ways to initialize `max`; choose the correct option(s).
Multiple correct
EASY
2 marks
29 October 2023
35
The given pseudocode is executed using the "Scores" dataset. There is a hypothesis that if a student performs well overall (i.e., scores at least 180 marks), then he/she must have performed well in all the subjects (i.e., scored at least 60 marks in each subject). At the end of execution, `fracTrue` stores the fraction of students who satisfy this hypothesis. Choose the correct code fragment(s). ``` countOverall = 0, countPerSub = 0 while(Table 1 has more rows) { Read the first row X from Table 1 if(X.Total > 180) { ******************** * Fill the code * ******************** } Move X to Table 2 } fracTrue = countPerSub / countOverall ```
Multiple correct
MEDIUM
4 marks
29 October 2023
36
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 ```
Multiple correct
MEDIUM
4 marks
29 October 2023
37
Choose the set of correct words in Table 2.
Comprehension
EASY
3 marks
29 October 2023
38
What will procedure `doSomething` return?
Comprehension
MEDIUM
4 marks
29 October 2023
39
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `A` captures the lowest Chemistry marks scored by a male student from Vellore. Choose the correct code fragment(s) to complete the pseudocode. ``` A = 101 while(Table 1 has more rows){ Read the first row X in Table 1 **** Fill the code **** Move X to Table 2 } ```
Multiple correct
MEDIUM
4 marks
16 July 2023
40
The following pseudocode is executed using the "Olympics" dataset. At the end of the execution, `A` stores the number of players who are either female from India or have won the match hosted by Australia in the year 2006, or both. The pseudocode may have mistakes. Identify all such mistakes, if any. Assume that all statements not listed in the options below are free of errors. ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 C = False, D = False if(X.Gender == "F" and X.HostCountry == "Australia"){ C = True } if(X.Year == 2006 and X.Nationality == "India"){ D = True } if(C or D){ A = A + 1 } Move X to Table 2 } ```
Multiple correct
MEDIUM
4 marks
16 July 2023
41
What would be the value of `s` at the end of the execution of the following pseudocode if the value of `n` is 1024? The operator `//` returns the quotient and the operator `%` returns the remainder. ``` s = 0, r = 0, n = 1024 while(n > 0){ r = n % 10 s = s + r n = n // 10 } ```
Numerical
EASY
4 marks
16 July 2023
42
Let `unit` be the number of units consumed by the consumer and `cost` be the amount of the bill to be paid. Choose the correct implementation to compute the cost.
Comprehension
EASY
3 marks
16 July 2023
43
The following pseudocode is executed using the "Words" dataset. What will `count` represent at the end of the execution? ``` count = 0, Flag = False while(Table 1 has more rows){ Read the first row X in Table 1 if(X.PartOfSpeech == "Noun"){ Flag = True } else{ if(Flag and X.PartOfSpeech == "Verb"){ count = count + 1 } } Move X to Table 2 } ```
Single correct
MEDIUM
3 marks
16 October 2022
44
Sripriya has used a variable `min` to find the minimum total score using the "Scores" dataset. There are many ways of initializing `min`. Choose the correct option(s) regarding the initialization of `min`.
Multiple correct
EASY
3 marks
16 October 2022
45
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of boys who scored at least 75 marks in Chemistry. Choose the correct code fragment(s) to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 ******** Fill the code ******** Move X to Table 2 } ```
Multiple correct
MEDIUM
4 marks
16 October 2022
46
The following pseudocode is executed using the "Library" dataset. Assume that Table 1 contains all the books authored by "Narayan" only. Also assume that the `Year` field of each book is distinct in the Table. Which of the following statement(s) are correct at the end of execution of this pseudocode? ``` Procedure groupBooks(Table 1) A = 2023, B = 0 while(Table 1 has more rows){ Read the first row Z from Table 1 if(Z.Year < A){ A = Z.Year B = Z.SeqNo } Move Z to Table 2 } while(Table 2 has more rows){ Read the first row X from Table 2 if(X.SeqNo == B){ Move X to Table 3 } else{ Move X to Table 4 } } End groupBooks ```
Multiple correct
MEDIUM
4 marks
16 October 2022
47
The following pseudocode is executed using the "Olympics" dataset. Procedure `doSomething` accepts a Table of rows which contains rows of the same player. Assume that every player has won at least two medals and only one medal in any year. What will `(B - A)` represent at the end of the execution? ``` Procedure doSomething(Table T1) A = 0, B = 0 while(Table T1 has more rows){ Read the first row Z from Table T1 if(Z.Year > A){ B = A A = Z.Year } if(Z.Year < A and Z.Year > B){ B = Z.Year } Move the row Z to Table T2 } return(A - B) End doSomething ```
Comprehension
MEDIUM
4 marks
16 October 2022
48
Kavya used a variable `miniBillTotal` to find the minimum total bill amount using the "Shopping Bills" dataset. There are many ways to initialize `miniBillTotal`. Choose the correct option(s).
Multiple correct
EASY
4 marks
05 June 2022
49
The following pseudocode is executed using the "Library" dataset. At the end of the execution, `N` captures the name of a book written in a language other than English with the maximum number of pages, and `A` captures the number of pages in the book. ``` A = 0, N = "None" while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Language != "English" and X.Pages > A){ A = X.Pages N = X.Name } Move X to Table 2 } ``` Assume that the rows of the table are shuffled in any random order. Choose the correct option(s).
Multiple correct
MEDIUM
4 marks
05 June 2022
50
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 ```
Multiple correct
HARD
4 marks
05 June 2022
51
The following pseudocode is executed using the "Scores" dataset. What will `A` represent at the end of the execution? ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Gender == "M" and X.CityTown == "Chennai"){ A = A + X.Mathematics } Move X to Table 2 } ```
Single correct
EASY
2 marks
05 June 2022
52
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` captures the maximum letter count among words that are not nouns. Choose the correct code fragment to complete the pseudocode. ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 *************** * Fill the code * *************** Move X to Table 2 } ```
Single correct
EASY
2 marks
05 June 2022
53
Let `X` be a row in the "Words" table. Let `isShortVerb` be a procedure to find whether the word in row `X` is a verb with letter count at most five. Choose the correct code fragment to complete the pseudocode. ``` Procedure isShortVerb(X) ******************** * Fill the code * ******************** End isShortVerb ```
Single correct
EASY
3 marks
05 June 2022
54
The following pseudocode is executed using the "Scores" dataset. What will `A` represent at the end of the execution? ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 B = True if(X.Physics >= 70){ B = False } if(X.Chemistry >= 70){ B = False } if(X.Mathematics >= 70){ B = False } if(B){ A = A + 1 } Move X to Table 2 } ```
Single correct
MEDIUM
3 marks
05 June 2022
55
The given pseudocode is executed using the "Scores" dataset. There is a hypothesis that if a student performs well overall, i.e. scores at least total 180 marks, then the student must have performed well in all the subjects, i.e. scored at least 60 marks in each subject. At the end of execution, `fracTrue` stores the fraction of students who satisfy this hypothesis. Choose the correct code fragment to complete the pseudocode. ``` countOverall = 0, countPerSub = 0 while(Table 1 has more rows){ Read the first row X in Table 1 if(X.Total >= 180){ ************************** * Fill the code * ************************** } Move X to Table 2 } fracTrue = countPerSub / countOverall ```
Single correct
MEDIUM
3 marks
05 June 2022
56
`miniSum` accepts three distinct numbers as parameters and returns the sum of two smallest numbers. Choose the correct code fragment to complete the procedure. ``` Procedure miniSum(A, B, C) Sum = 0 if(A > C and A > B){ Sum = B + C } ******************** * Fill the code * ******************** return(Sum) End miniSum ```
Single correct
MEDIUM
4 marks
10 July 2022
57
What will procedure `doSomething` return?
Comprehension
MEDIUM
4 marks
10 July 2022
Showing 57 questions.