Skip to content

CT Week 7 Graded Assignments IIT Madras

 

Computational Thinking week 7 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.Let D be a non-empty dictionary. Choose the correct option(s). It is a Multiple Select Question (MSQ).

Let a be a key of dictionary D, then a is always an integer.

For keys a and b in D, if a != b then D[a] != D[b] is always True.

For keys a and b in Da != b is always True.

Let D = { ‘a’: 5, ‘b’ : 4, ‘c’ : 6}, then the value of D[4] is ‘b’.

 
 

2.Let Z be a row in the “Words” table such that Z.Word = “reluctant”. What will be the value of alphaDict[‘t’] at the end of the execution of the following pseudocode? (NAT)

 
 
 
 
 
4 points
 
3 points
 

3.The following pseudocode is executed using the “Library” dataset. At the end of the execution, A stores a dictionary with the author’s name as key mapped to the number of books written by him/her. But the code may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ).

 
 
 

 

 
 

Replacing the condition given in line 4 with the statement given below will provide the correct result.

 
 
 
 

Interchanging Line 4 and 7 will provide the correct result.

Interchanging Line 5 and 8 will provide the correct result.

The pseudocode will provide the correct result even without getting modified.

 
4 points
 

4.The following pseudocode is executed using the “Library” Dataset. At the end of the execution, firstBook stores a dictionary with the author’s name as key mapped to the genre of their first published book. But the code may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. Assume that the rows are arranged in ascending order of publication years of the books. It is a Multiple Select Question (MSQ).

 
 
 

 

 

Line 1: Incorrect initialization of firstBook

Line 4: Incorrect conditional statment

Line 7: There should always be an “else” block after “if” block

No mistakes

 

Question (5 – 7)

Use the procedure doSomething given below for answering questions 5, 6, and 7.

 
 
 

 

 
3 points
 

What will be the value of B at the end of the execution of the following pseudocode.

 
 
 

 

 

[3, 4, 5, 1, 9, 4, 6, 5, 9]

[3, 4, 5, 1, 9, 6]

[1, 6]

[4, 1, 3, 4, 6, 5, 9]

 
4 points
 

The following pseudocode is executed using the “Words” dataset and the procedure doSomething mentioned above. What will sList store at the end of the execution.

 
 
 

 

 

List of words from the “Words” dataset.

List of unique words from the “Words” dataset.

List of lists of words of each sentence from the “Words” dataset.

List of lists of unique words of each sentence from the “Words” dataset

 
4 points
 

The following pseudocode is executed using the “Words” dataset and the procedure doSomething mentioned above. Let explode(W) returns a list of characters of word W in the same order as they are in the word. For example explode(“thinking”) returns [‘t’, ‘h’, ‘i’, ‘n’, ‘k’, ‘i’, ‘n’, ‘g’]. Ignore the punctuations like comma, full stop and so on. What will someList store at the end of the execution.

 
 
 

 

 

List of alphabets from the “Words” dataset.

List of unique alphabets from the “Words” dataset.

List of lists of alphabets of each word from the “Words” dataset.

List of lists of unique alphabets of each word from the “Words” dataset

 

Question (8 – 9)

Let MP, and C be a list of sequence numbers of students who have scored more than the average marks in Mathematics, Physics and Chemistry respectively using the “Scores” dataset. Answer question 8 and 9 after executing the following pseudocode.

 
 
 

 

 
4 points

If seqDict[n] == 0 is a True statement, then choose the correct option(s) regarding the student with sequence number n. It is a Multiple Select Question (MSQ).

The student has scored more than the average marks in any one of the three subjects.

The student has not scored more than the average marks in any subject.

The student might have scored more than the average marks either in Physics or in Chemistry

The student has scored more than the average marks in Mathematics only

 
3 points

If seqDict[n] == 1 is a True statement, then choose the correct option(s) regarding the student with sequence number n. It is a Multiple Select Question (MSQ).

The student has scored more than the average marks in Physics and Chemistry but not in Mathematics .

The student has scored more than the average marks in Mathematics and might have scored more than the average marks in Physics but not in Chemistry.

The student has scored more than the average marks in Mathematics and might have scored more than the average marks in Chemistry but not in Physics.

The student has scored more than average marks in any two of three subjects.

 
4 points
 

The following pseudocode is executed using the “Words” dataset. Let unique(L) returns the list of unique elements of L. What will wCount represent at the end of the execution of the pseudocode? Ignore the upper and lower case, and punctuation symbols while comparing with other words.

 
 
 

 

 

Dictionary with words as keys mapped to the number of sentences in which the word is present.

Dictionary with words as keys mapped to the frequency count of the word in the dataset.

Dictionary with words as keys mapped to the maximum frequency of the word in a sentence.

Dictionary with words as keys mapped to the number of sentences in which the word is present more than one time.

WhatsApp
Telegram
Print
Facebook

Leave a Reply

Your email address will not be published. Required fields are marked *