0% found this document useful (0 votes)
2K views

Computational Thinking Iit

Worksheets plus answers of iit madras computational thinking

Uploaded by

nesramesses
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
2K views

Computational Thinking Iit

Worksheets plus answers of iit madras computational thinking

Uploaded by

nesramesses
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 11
cE SRE Fae eon liaree(-te(c-\-N ua -Cen CO Graded Assignment- 2 x 1) The following procedure counts 3 points the number of students from Mumbai whose total marks are more than the average total marks from the “Scores” dataset and stores it in variable A. Let avgT be the average total marks. The programmer may have made mistakes in one or more steps. Identify all such steps (if any). It is a Multiple Select Question (MSQ). Step 1: Arrange all cards in a single pile called Pile 1 Initialize variable A to 0 If Pile 1 is empty then stop the iteration Read the top card in Pile 1 If X.CityTown == “Mumbai” and X. Total > av Move the current card to another pile called Pile Step 2 O (Step 2 (Step 2 (0 Step 2 fe Step 2 No mistake e@ cE SRE Fae eon liaree(-te(c-\-N ua -Cen CO Graded Assignment- 2 2) The following procedure takes 3 points data from the “Scores” dataset and counts the number of female students whose Physics marks are more than their Chemistry marks but less than their Mathematics marks and stores it in variable A. The programmer may have made mistakes in one or more steps. Identify all such steps (if any). Itis a Multiple Select Question (MSQ). Step 1 all cards in a single pile called Pile 1 lize variable A to 1 ile 1 is empty then stop the iteration Arran Ini I F p 5: Mf Gender is ‘F” and Mathematics marks < Physic ad the top card in Pile 1 Chemistry marks < Physics marks then add 1 to Step 6: Move the current card to another pile called Pile + 3 Step 2 Step 3 8 0 Step 5 Step 6 OO No mistake Lx |=] e@ co bey SPOR Fae eon liaree(-te(c-\-N ua -Cen CO =] Graded Assignment- 2 x 3) The given procedure finds the 4 points number of sentences with maximum number of words from the “Words” dataset. Fill in the blanks from the given choices and complete the procedure. iables A, B and cot Step 3: If Pile 1 is empty then stop the iteration Step Step J: Read the top card in Pile 1 Step 5: Add 1 to variable A Step 6: If Word ends with a full stop and A > B then st Step 7 Step 8: If Word ends with a full stop then reinitialize At Step 9: Move the current card to another pile called Pile If Word ends with a full stop and A< © Bthen store BINA, assign 1 to count If Word ends with a full stop and A< oO Bthen assign 1 to count . If Word ends with a full stop and A == B then add 1 to count If Word ends with a full st id E o ord ends with a full stop and, == B then assign 1 to count e@ coma) cE SRE Fae eon liaree(-te(c-\-N ua -Cen CO Graded Assignment- 2 x 4) What will (A-B) represent after 4 points execution of the following procedure using the “Shopping Bills” dataset? Step 1: Arrange all cards in a single pile called Pile 1 Step 2: Initialize variables A and B to 0 Step 3: If Pile 1 is empty then stop the iteration Step 4: Read the top card in Pile 1 Step 5: Mf the bill contains an item “Milk” then add 1 to Step 6: If Name == “Srivatsan” and the bill contains an| then add 1 to variable B Step 7: Move the current card to another pile called Pile Number of Srivatsan’s bills which do not contain the item “Milk” Number of bills other than © Srivatsan’s which do not contain the item “Milk” Number of bills other than @ Srivatsan’s which contain the item “Milk” Number of bills which contain th~ item “Milk” e@ coma) cE SRE Fae eon liaree(-te(c-\-N ua -Cen CO Graded Assignment- 2 5) What will the value of B be after execution of the following procedure using the “Scores” dataset? Step 1: Arrange all cards in a single pile called Pile 1 Step 2: Initialize variables A and B 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 Physics marks is not less than Mathematics me (Physics marks — Mathematics marks) in A Step 6: If A>B then store Ain B Step 7: Move the current card to another pile called Pile 28 4 points 6) The given procedure is executed 4 points on the “Scores” dataset. What will min represent after execution of the procedure? | Step 1 Arrange all cards in a single | Step 2: Initialize variables A, B, C | Step 3: If Pile 1 is empty th >1 | Step 4: Read the top card it l | Step 5 If Mathematics Mathommemes t coma) cE SRE Fae eon liaree(-te(c-\-N ua -Cen CO Graded Assignment- 2 6) The given procedure is executed 4 points on the “Scores” dataset. What will min represent after execution of the procedure? | Step 1 Arrange all cards in a single Step 2: Initialize variables A, B, C Step 3 If Pile 1 is empty then stop 1 Step 4 Read the top card in Pile 1 Step 5: If Mathematics marks < At Step 6: If Physics marks < B then Step 7: If Chemistry marks < C the Step 8: Move the current card to anc Step 9 If A < B then store A in m Step 10: If C < min then store C in Po © Lowest Mathematics marks ©. Lowest Physics marks ©. Lowest Chemistry marks © Lowest marks across all subject ae OB @® None of these cE ii Omen on lates eM ue-CenTa) Graded Assignment- 2 if (X. Chemistry > 75) { C=C+l1 } if (C <2) { count = count + 1 } Move X to Table 2 Number of students who scored more than 75 marks in at least two subjects ° Number of students who scored more than 75 marks in two subjects Number of students who scored @ more than 75 marks in at most two subjects Number of students who scored © more than 75 marks in all three subjects ©. None of these ge 18:46 ii Fae eon liaree(-te(c-\-N ua -Cen CO Graded Assignment- 2 8) What will be the value of C? 30 2 points 9) What will the value of (C-A) 4 points represent? Number of students whose Mathematics marks are at least as much as Physics marks Number of students whose {) Mathematics marks are at most as much as Physics marks Number of students whose Physics (J marks are at least as much as Mathematics marks Number of students whose Physics marks are at most as much as Mathematics marks (None of these ap 18:46 ii Fae eon liaree(-te(c-\-N ua -Cen CO Graded Assignment- 2 10) What will the value of (C-B) 3 points represent? Number of students whose @ Mathematics marks are equal to Physics marks Number of students whose o Mathematics marks are more than Physics marks Number of students whose ° Mathematics marks are less than Physics marks Number of students whose Physics © marks are less than or equal to Mathematics marks 11) The following pseudocode is 4 points executed using the “Scores” dataset aa & 18:46 SRE @ k.onlinedegree.iitm.acin © © Graded Assignment- 2 When will C be True? If there are more male students from © Bangalore than female students from Chennai If there are more female students © from Chennai than female students from Bangalore If there are more female students e from Chennai than male students from Bangalore If there are more students from © Chennai than students from Bangalore 12) A principal wants to send 4m oa students of her college to participate in ar ate snorts festival She 18:46 SRE Fae eon liaree(-te(c-\-N ua -Cen CO Graded Assignment- 2 more steps. Identify all such steps (if any). It is a Multiple Select Question (MSQ). Step 1: Arrange all cards in a single pile called Pile 1 Initialize va le X to 0 If Pile 1 is empty then stop the iteration Read the top card in Pile 1 If the student plays greater than or equal to 3 ga If the student does not play “Cricket” then If the student does not play “Football” then go t > to Increment X Move the current card to another pile called Pile Step 5 (0 Step 6 Step 7 (J Step 8 (No mistake STASI) e@

You might also like