0% found this document useful (1 vote)
11K views

IITM Computational Thinking Graded Assignment Week 1

The document is a graded assignment for a computational thinking course consisting of 10 multiple choice questions covering various concepts: Question 1-3 ask about the values of variables A, B, and C after running a procedure on a dataset to categorize records based on date of birth. Question 4 asks about the result of running a procedure to count nouns and sentences on a word dataset. Question 5 involves initializing variables and comparing revenue for different product categories in a shopping bills dataset. Question 6 counts the number of stores visited by a customer based on records in a shopping bills dataset. Question 7 identifies any mistakes in a procedure to count words based on part of speech and letter count. Questions 8 and 9 involve identifying errors in a sample
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
11K views

IITM Computational Thinking Graded Assignment Week 1

The document is a graded assignment for a computational thinking course consisting of 10 multiple choice questions covering various concepts: Question 1-3 ask about the values of variables A, B, and C after running a procedure on a dataset to categorize records based on date of birth. Question 4 asks about the result of running a procedure to count nouns and sentences on a word dataset. Question 5 involves initializing variables and comparing revenue for different product categories in a shopping bills dataset. Question 6 counts the number of stores visited by a customer based on records in a shopping bills dataset. Question 7 identifies any mistakes in a procedure to count words based on part of speech and letter count. Questions 8 and 9 involve identifying errors in a sample
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Computational Thinking

Graded assignment week 1


 

Computational Thinking
Graded assignment week 1
Question 1 to 3
Question 1 [2 Marks]
Question 2 [2 Marks]
Question 3 [2 Marks]
Question 4 [4 Marks]
Question 5 [5 Marks]
Question 6 [5 Marks]
Question 7 [5 Marks]
Question 8 [5 Marks]
Question 9 [5 Marks]
Question 10 [5 Marks]

Question 1 to 3
What will be the values of A, B and C after execution of the following procedure using the "Scores"
dataset?

Step 1: Arrange all cards in a single pile called Pile 1

Step 2: Maintain three variables A, B, C 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: If Date of Birth < "1 May" then increment A

Step 6: If Date of Birth > "30 April" and Date of Birth < "1 September" then increment B

Step 7: If Date of Birth > "31 August" then increment C

Step 8: Move the current card to another pile called Pile 2 and repeat from step 3

Question 1 [2 Marks]

The value of A is _ _ _ _ ?

Question 2 [2 Marks]

The value of B is _ _ _ _ ?

Question 3 [2 Marks]

The value of C is _ _ _ _ ?
Question 4 [4 Marks]
What will variable A represent after execution of the following procedure on the "Words" dataset?

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: If Part of speech is "Noun" then increment B

Step 6: If the Word does not end with a full stop then execute step 9

Step 7: If the Word ends with a full stop and B is equal to 1 then increment A

Step 8: Reset the variable B to 0

Step 9: Move the current card to another pile called Pile 2 and repeat from step 3

(a) Total number of nouns in the dataset

(b) Total number of sentences with only one noun in it

(c) Total number of sentences in the dataset

(d) Total number of sentences with at least one noun in it

Question 5 [5 Marks]
The given procedure finds the category which has generated the higher revenue between
"Electronics" and "Stationery" when executed on the "Shopping Bills" dataset. Fill in the blanks
from the given choices and complete the procedure.

Step 1: Arrange all cards in a single pile called Pile 1

Step 2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Step 3: If Pile 1 is empty then stop the iteration and start from step 8

Step 4: Read the top card in Pile 1

Step 5: If the bill contains one or more items with Category "Electronics" then add Cost of all such
items to Ecost

Step 6: If the bill contains one or more items with Category "Stationery" then add Cost of all such
items to Scost

Step 7: Move the current card to another pile called Pile 2 and repeat from step 3

Step 8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Step 9: If Ecost Scost then store "Electronics" in higher

Step 10: If Scost Ecost then store "Stationery" in higher

a. Step 2: Maintain two variables Ecost, Scost and initialize them to 0

Step 8: Maintain a variable higher and initialize it to 0

b. Step 2: Maintain two variables Ecost, Scost and initialize them to "None"

Step 8: Maintain a variable higher and initialize it to "None"

c. Step 2: Maintain two variables Ecost, Scost and initialize them to 0

Step 8: Maintain a variable higher and initialize it to "None"

d. Step 2: Maintain two variables Ecost, Scost and initialize them to "None"

Step 8: Maintain a variable higher and initialize it to 0


Question 6 [5 Marks]
What will the given procedure compute and store in variable X if executed on the "Shopping Bills"
dataset?

Step 1: Arrange all cards in a single pile called Pile 1

Step 2: Maintain three variables A, B, C and initialize them to 0

Step 3: If Pile 1 is empty then stop the iteration and start from step 9

Step 4: Read the top card in Pile 1

Step 5: If the Shop name is "SV Stores" and Customer name is "Neeraja" then set A equal to 1

Step 6: If the Shop name is "Big Bazaar" and Customer name is "Neeraja" then set B equal to 1

Step 7: If the Shop name is "Sun General" and Customer name is "Neeraja" then set C equal to 1

Step 8: Move the current card to another pile called Pile 2 and repeat from step 3

Step 9: Maintain a variable X and initialize it to 0

Step 10: If A is equal to 1 then increment X

Step 11: If B is equal to 1 then increment X

Step 12: If C is equal to 1 then increment X

(a) Numbers of times Neeraja has visited SV Stores

(b) Numbers of times Neeraja has visited Sun General

(c) Numbers of times Neeraja has visited Big Bazaar

(d) Number of stores which Neeraja visited

(e) Number of stores which Neeraja never visited

Question 7 [5 Marks]
The following procedure counts the number of words from the "Words" dataset where Part of
speech is "Noun" and Letter count is greater than or equal to 4. But 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

Step 2: Maintain a variable count and initialize it to 1

Step 3: If Pile 1 is empty then stop the iteration

Step 4: Read the top card in Pile 1

Step 5: If Part of speech is "Verb" and Letter count 4 then increment count

Step 6: Move the current card to another pile called Pile 2 and repeat from step 3

(a) Step 1

(b) Step 2

(c) Step 3

(d) Step 4

(e) Step 5

(f) No mistake

 
Question 8 [5 Marks]
The given information represents a "Shopping Bill" and it may have some mistakes with respect to
the sanity of data. Identify all rows with such mistakes. It is a Multiple Select Question (MSQ).

Row no. Item Category Qty Price Cost

Row 1 Cereal Packed/Food 1 220 220

Row 2 Milk Fruits/Food 1 24 24

Row 3 Cupcakes Packed/Food 1 25 25

Row 4 Chocolates Packed/Food 1 10 100

Row 5 Shirts Women/Apparel 1.5 1350 2025

(a) Row 1

(b) Row 2

(c) Row 3

(d) Row 4

(e) Row 5

Question 9 [5 Marks]
Match the following by selecting the most appropriate datatype.

Field name Datatype

1. Number of students in a class i. Integer

2. Email address ii. Character

3. Position of a word in a setence iii. Boolean

4. State of an electric switch iv. String

5. Value of mathematical constant v. Float

Question 10 [5 Marks]
Interpret the following flowchart and answer the questions. Let A, B and C be three distinct
integers given as input.
What will X represent at the end of flowchart?

(a) Second smallest number among A, B and C

(b) Second largest number among A, B and C

(c) Largest among A, B and C

(d) Smallest among A, B and C

You might also like