Skip to content

CT Week 2 Graded Assignments IIT Madras

Computational Thinking week 2 graded assignment Complete  Solutions Are Discussed In This Blog. We Hope This Might Help You All In Matching Answers . Or For Some Others Reasons If Not Able To Complete Graded Assignments 

  1. The following procedure is executed using the “Scores” dataset. At the end of the execution, diff stores the difference between the highest and lowest total marks. The programmer may have made mistakes in one or more steps. Identify all such steps (if any). Assume that all the steps not mentioned in options are free from errors. It is a Multiple Select Question (MSQ).
    Step 1. Arrange all cards in a single pile called Pile 1
    Step 2. Initialize variables max to 0, min to 300, and diff to 0
    Step 3. If Pile 1 is empty then go to step 8
    Step 4. Read the top card in Pile 1
    Step 5. If Total < max then store Total in max
    Step 6. If Total < min then store Total in min
    Step 7. Move the current card to another pile called Pile 2 and repeat from step 3
    Step 8. Update value of diff to (max – min) 
 
2.  Match the following expressions in the Column 1 with the appropriate values in column 2.
 
3. The following procedure is executed using “Words” dataset. What will A represent at the end of the execution?
Step 1. Arrange all cards in a single pile called Pile 1
Step 2. Maintain two variables A, B and initialize them to 0
Step 3. If Pile 1 is empty then stop the iteration
Step 4. Read the top card in Pile 1
Step 5. Increment variable B
Step 6. If Word does not end with a full stop then execute step 9
Step 7. If Word ends with a full stop and B > A then store B in A
Step 8. Re-initialize the variable B to 0
Step 9. Move the current card to another pile called Pile 2 and repeat from step 3
 

4.  The following procedure is executed using “Words” dataset. What will A and B represent at the end of the execution?
Step 1. Arrange all cards in a single pile called Pile 1
Step 2. Maintain two variables A, B and initialize them to 100000
Step 3. If Pile 1 is empty then stop the iteration
Step 4. Read the top card in Pile 1
Step 5. If Mathematics Marks < A, then store A in B and Mathematics Marks in A
Step 6. If Mathematics Marks > A and Mathematics Marks < B, then store Mathematics Marks in B
Step 7. Move the current card to another pile called Pile 2 and repeat from step 3

 
5.  The given procedure is executed using the “Scores” dataset. Kajal and Rashmita both have scored the lowest mark in Physics which is 37. Let all the cards be arranged in a single pile called Pile 1 in such a way that Kajal’s card is below Rashmita’ s card. What will the values of A and B be at the end of the execution?
Step 1. Maintain two variables A and B and initialize them to 101 and “None” respectively
Step 2. If Pile 1 is empty then stop the iteration
Step 3. Read the top card in Pile 1
Step 4. If Physics marks <= A, then store Physics marks in A and store student’s name in B
Step 5. Move the current card to another pile called Pile 2 and repeat from step 2
 
6.  The following pseudocode is executed using the “Scores” dataset. What will count represent at the end of the execution of pseudocode?


 

7.  he following procedure is executed using “Scores” dataset. What will X and Y represent at the end of the execution?
Step 1. Arrange all cards in a single pile called Pile 1
Step 2. Maintain variables A, B, Y and Initialize them to 0
Step 3. Maintain a variable X and initialize it to “None”
Step 4. If Pile 1 is empty then stop the iteration
Step 5. Read the top card in Pile 1
Step 6. If the Gender is ‘F’ then add one to A. If A > Y then store A in Y and “Female” in X
Step 7. If the Gender is ‘M’ then add one to B. If B > Y then store B in Y and “Male” in X
Step 8. Move the current card to another pile called Pile 2 and repeat from step 4

 
8.  The given pseudocode is executed using the “Words” dataset. At the end of the execution, count finds the number of sentences with least number of words. Choose the correct option to complete the pseudocode
 
9.  The following pseudocode is executed using the “Words” dataset. At the end of the execution, A captures the minimum letter count of an adjective. Choose the correct code fragment(s) to complete the pseudocode. It is Multiple Select Question (MSQ).