0% found this document useful (0 votes)
847 views10 pages

CT-1 (Week-1)

Computational Thinking Week-1

Uploaded by

waxote8478
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)
847 views10 pages

CT-1 (Week-1)

Computational Thinking Week-1

Uploaded by

waxote8478
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/ 10
8129124, 9:22 AM (CT Week 1 Graded Assignments IT Madras - Students Community ( cy Students Community CL] DOE Ree Coen Cet itis COMPUTATIONAL THINKING-1 a aire} RR See ee CT Week 1 Graded Assignments IIT Madras by ] August 9, 2023 / Computational Thinking week 1 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 What will be the values of A, B and C after execution of the following procedure using the “Scores” dataset? Step I: Arrange all cards in a single pile called Pile 1 Step 2: Maintain three var ialize them to 0 bles A, B, C andi ritps:igradedassignments github iofet-week-t-graded-assignments-ittmadras! 0 8129124, 9:22 AM (CT Week 1 Graded Assignments IT Madras - Students Community Step 3:1f Pile lis empty then stop the iteration Step 4: Read the top card in Pile! Step 5: If Mathematics < 50 then increment A Step 6: If Physics < 50 then increment B Step 7: If Chemistry < 50 then increment C Step 8: Move the current card to another pile called Pile 2 and repeat from step 3 1. The value of Ais 2 2. The value of Bis 1 3. The value of Cis 1 4.What will variable B represent after execution of the following procedure on the “Words” dataset? Step I: Arrange alll cards in a single pile called Pile 1 Step 2: Maintain two variables A, B and initialize them to 0 Step 3: If Pile | is empty then stop the iteration Step 4: Read the top card in Pile 1 Step 5: If PartOfSpeech is “Verb” then increment A Step 6: If the word does not end with a full stop then execute Step 9 Step 7:|f the word ends with a full stop and A is greater than | then increment B Step 8: Reset the variable A to 0 Step 9: Move the current card to another pile called Pile 2 and repeat from Step 3 Total number of verbs in the dataset Total number of sentences with only one verb in it Total number of sentences with at least two verbs in it ritps:igradedassignments github iofet-week-t-graded-assignments-ittmadras! ano 8129124, 9:22 AM (CT Week 1 Graded Assignments IT Madras - Students Community Total number of sentences with at least one verbs in it 5. A student proposed a hypothesis that less number of students are born in the first half of the year than the second half of the year. She wrote the following procedure which uses the “Scores” dataset to verify the hypothesis. However, the procedure present. may contain some errors. Find out the error: Step 1: Arrange all cards in a single pile called Pile 1 Step 2: Maintain two variables A and B and initialize them to 0 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 Date of Birth is from Ist January to 30th June then increment A Step 6: If the Date of Birth is from Ist July to 3ist December then increment B Step 7: Move the current card to another pile called Pile 2 and repeat from Step 3 Step 8: If A> B then declare the hypothesis to be True Step 9: If ASB then declare the hypothesis to be False Step 5 to increment A is incorrect Step 6 to increment B is incorrect Step 8 to declare the hypothesis as True is incorrect Step 9 to declare the hypothesis as False is incorrect The procedure is free of errors 6. What will variable X represent after execution of the following procedure on the “Shopping Bills” dataset? ritps:igradedassignments github iofet-week-t-graded-assignments-ittmadras! ano ‘ras, 9:22am CCT Week 1 Graded Assignments ITT Madras - Students Community Step I: Arrange all cards in a single pile called Pile 1 Step 2: Maintain four variables A, B, C, X 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 “Suresh” then set A equal to 1 Step 6: If the Shop name is “Big Bazaar” and Customer name is “Suresh” then set B equal to 1 Step 7: If the Shop name is “Sun General” and Customer name is “Suresh’ then set C equal to1 Step 8: Move the current card to another pile called Pile 2 and repeat from Step 3 Step 9: Update the value of Xas X=A+B+C Number of distinct stores Suresh has visited Number of distinct stores Suresh never visited Numbers of times Suresh has visited Sun General Numbers of bills in the dataset belong to Suresh 7. The following procedure is executed using the “Olympics” dataset. Step I: Arrange all cards in a single pile called Pile 1 Step 2: Maintain a variable X and initialize it to True Step 3:If Pile lis empty then stop the iteration Step 4: Read the top card in Pile] Step 5: If the Gender is “F” and Nationality is “Korean” then set X equal to False Step 6: Move the current card to another pile called Pile 2 and repeat from step 3 At the end of the execution, X will be True if there exist at least one female player who is not from Korea there exist at least one female player who is from Korea all the female players are from countries other than Korea all the female players are from Korea only ritps:igradedassignments github iofet-week-t-graded-assignments-ittmadras! ano 8129124, 9:22 AM (CT Week 1 Graded Assignments IT Madras - Students Community 8. The following procedure is executed using the “Library” dataset. At the end of the execution, count stores the number of books written by “Shakespeare” and published in “Morning Star” publications. 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 I: Arrange alll cards in a single pile called Pile 1 Step 2: Maintain a variable count and initialize it to 1 Step 3:If Pile lis empty then stop the iteration Step 4: Read the top card in Pile 1 Step 5: If Author == “Shakespeare” or Publisher == “Morning Star” then increment count Step 6: Move the current card to another pile called Pile 2 and repeat from step 3 Step 2: Incorrect initialization of the variable count Step 3: Incorrect step for stopping the iteration Step 5: Incorrect condition to update count Step 6: Incorrect step indicated from where the procedure has to be repeated 9. The following procedure is executed using the “Olympics” dataset. At the end of the execution, count stores the number of Indian players who have won a “Gold” medal. But the programmer has missed few Steps. Identify all correct Steps. Step 1: Arrange all cards in a single pile called Pile 1 Step 2: Maintain a variable count and initialize it to 0 ritps:igradedassignments github iofet-week-t-graded-assignments-ittmadras! 510 8129124, 9:22 AM (CT Week 1 Graded Assignments IT Madras - Students Community Step 4: Read the top card in Pile1 Step 6: Move the current card to another pile called Pile 2 and repeat from Step 3 Step 3:If Pile lis empty move to Pile 2 Step 5: If HostCountry == “Indian” or Medal = old" then increment count Step 3:If Pile lis empty then stop the iteration Step 5: If Nationality Indian” or Medal == “Gold” then increment count Step 3: If Pile lis empty move to Pile 2 Step 5: If Nationality == “Indian” or Medal == “Gold” then increment count Step 3: f Pile 1is empty then stop the iteration Step 5: If Nationality == “Indian” and Medal == “Gold” then increment count Step 3:If Pile lis empty then stop the iteration Step 5: If HostCountry == “Indian” and Medal == “Gold” then increment count ritps:igradedassignments github iofet-week-t-graded-assignments-ittmadras! eo Detailed Answers Solution 1,2,3 In this question we have to find exact values of three variables A, B and C. So, let us start with the procedure. Here in step 2 we have declared three variables A, B, C and also initialized them to 0. In step 5, variable A is getting incremented if Mathematics marks of a student is less than 50 which means we are counting the number of students who have secured less than 50 marks in Mathematics. In step 6, variable B is getting incremented if Physics marks of a student is less than 50 which means we are counting the number of students who have secured less than 50 marks in Physics. In step 7 we are checking for the students whose Chemistry marks are less than 50 which means variable C is counting the number of students who secured less than 50 marks in Chemistry. It is a repeat step which indicates that this procedure is getting executed on all the cards available in the dataset. Therefore, if we compile all the Mathematics, Physics and Chemistry marks from the dataset 4, Let us analyze the given procedure, in Step 2 two variables A and 8 are initialized to 0. In Step 5 variable A is getting incremented if Partofspeech is “Verb” which means variable A is counting number of Verbs. Conditions in Steps 6 and 7 are exactly opposite to each other. As per the combination of Steps 6 and 9 we are counting nouns with variable A until we reach to a full stop. In other words, we are counting number of Verbs in each sentence. As per Step 7 if a sentence ends and Verb count in variable A is greater than | then we are incrementing variable B. Step 8 resets the value of variable A so that the same variable can be used to count number of Verbs in the next sentence. Based on this analysis we can conclude that the variable B gets incremented only if variable A’s value is greater than I which means if Ais 2 or more. Hence, the answer of this question is Total number of sentences with at least two verbs in it. 5. In Step I cards are arranged into a single pile and which is called as Pile 1. In Step 2 we are creating two variables called A and B then assigning the value 0 to them. Step 3 checks whether the iteration has to be continued or not. If the pile 1 is empty then the iteration has to be stopped. In Step 4, the top card of the Pile | is taken and read. Now, one has to count the number of people who are born in the first half of the year and who are born in the second half of the year. In Step 5, we increment A if a ritps:igradedassignments github iofet-week-t-graded-assignments-ittmadras! m0 ‘ras, 9:22am CCT Week 1 Graded Assignments ITT Madras - Students Community student is born from Ist January to 30th June. In Step 6, we increment B if a student is born from Ist July to 31st December. In Step 7, the current card is moved to another called Pile 2 and the procedures are repeated from Step 3. After reading all cards, variables A and 8 will store the number of students whose Date Of Birth are in the first and the second half of the year respectively. So to verify the hypothesis, the values of A and B should be compared with each other. If the value of A is less than B it will confirm the hypothesis to be True and if the value of A is greater than or equal to B it will confirm the hypothesis to be False. Hence, Step 8 and 9 are incorrect. The correct answers are (c) and (d). 6,7. Variables A, 8, C, and X are initialized to 0 in Step 2. In Step 5 variable A’s value will be set to 1 if “Suresh” has a shopping bill from “SV stores’. Similarly, in Step 6 variable B's value will be set to 1 if he has a bill from “Big Bazaar’ and variable C’s value for “Sun Genera’ in Step 7. In Step 9 value of X is updated to with sum of A, B and C. Values of variables A, B and C either | or 0 based on the information if “Suresh” has visited the corresponding shop or not. Therefore, X will store the number of distinct shops visited by Suresh. LeaveaReply Your email address will not be published. Required fields are marked * Name * Email * Website ritps:igradedassignments github jofet-week-t-graded-assignments-it-madras! ano 8129124, 9:22 AM (CT Week 1 Graded Assignments IT Madras - Students Community Comment * a Save my name, email, and website in this browser for the next time | comment. Post Comment Tag} Copyright © 2023 IITM Students Community All Rights Reserved. PrivacyandTerms Privacy Policy REFUND POLICY Contact Us. ‘COUNT STORES THE NUMBER OF BOOKS WRITTEN BY “SHAKESPEARE” AND PUBLISHED IN “MORNING STAR” PUBLICATIONS. (CT WEEK 1 GRADED ASSIGNMENTS ‘THE FOLLOWING PROCEDURES EXECUTED USING THE “LIBRARY” DATASET. AT THE END OF THE EXECUTION ‘THE FOLLOWING PROCEDURES EXECUTED USING THE “OLYMPICS” DATASET. WEEK IGRADED ASSESSMENTIITMADRAS — WEEKIGRADED ASSIGNMENTS WHAT WILL BE THE VALUES OF A WHAT WILL VARIABLE B REPRESENT AFTER EXECUTION OF THE FOLLOWING PROCEDURE ON THE “WORDS” DATASET? WHAT WILL VARIABLE X REPRESENT AFTER EXECUTION OF THE FOLLOWING PROCEDURE ON THE “SHOPPING BILLS” DATASET? https lgradedassignments.gthubiolet-wesk-1-graded-assignments-it-madras! sro 8129124, 9:22 AM (CT Week 1 Graded Assignments IT Madras - Students Community ritps:igradedassignments github iofet-week-t-graded-assignments-ittmadras! sono

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy