0 ratings0% found this document useful (0 votes) 953 views27 pagesCT-1 (Week-4)
Computational Thinking Week-4
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
8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Students Community CL]
DOE Ree Coen een itis
COMPUTATIONAL
THINKING-1
Al Support For Qualif
CT Week 4 Graded Assignments IIT
Madras
by | August 9, 2023 /
Computational Thinking week 4 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 For which of the following situations is a nested loop needed? Assume that no procedure is used, Itis a Multiple
Question (MSQ),
To find the number of authors who have written a book in “French” in 2007 from the “Library”
dataset.
To find the number of pair of students who have scored the same Physics marks from the “Scores”
dataset
ritps:igradedassignments github iofct-week-4-graded-assignments-ittmadras! wer8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
To find the number of players who have won the medal in “Wrestling” from the “Olympics” dataset
To find the number of students with at least two vowels in their name from the “Scores”
dataset.
2. The following pseudocode is executed using the “Words” dataset, Assume that length(x) is a procedure that returns the
‘number of letters present in a word x. What will A represent at the end of the execution?
Ana
wnile(Table 1 has more rows){
Read the first row x in Table 1
ist, B= True
X.Name
while(4 <= length(c)){
if(ith letter of ¢ 4s a vowel){
B= False
}
asia
}
iF(B)¢
Asai
}
Move X to Table 2
‘Number of students whose names are without vowels
Number of students whose names have at most one vowel
Number of students whose names have exactly one vowel
Number of students whose names have at least one vowel
3. The following pseudocode is executed using the “Library” dataset. What will C represent at the end of the execution?
Assume that there is only one row corresponding to each author in the *
ibrary” dataset.
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignments-it-madras! 2er8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
c-0
while(Table 1 has more rows){
Read the first row X in Table 1
Nove X to Table 2
while(Table 1 has more rows)(
Read the first row Y in Table 1
Af(Findpain(X, ¥)){
cece.
y
Move Y to Table 3
}
Nove all ros from Table 2 to Table 1
)
Procedure findPair(x, Y)
if (X.Genre == ¥.Genre and X.Language |= Y.Language){
return(True)
y
elset
eturn(False)
i}
End FindPair
Number of authors who have written different genre books in same language
Number of pairs of authors who have written different genre books in same language
Number of authors who have written same genre books in different language
‘Number of pairs of authors who have written same genre books in different language
4, Two words are said to be special if they fulfill following conditions
Number of vowels are same in both the words
Number of consonants are not same in both the words
The given pseudocode is executed using the “Words” dataset. The variable count in the given pseudocode counts the
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignments-it-madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
number of special pairs. Choose the correct code fragment to complete the pseudocode
count = @
while(Table 1 has more rows){
Read the first row x in Table 1
Move X to Table 2
uhile(Table 1 has more rows){
Read the first row Y in Table 1
Fal] here
Nove ¥ to Table 3
,
Move all rows fron Table 3 to Table 1
Procedure vCount(2)
vowelcount = 2, L= 1
while(i <= Z.LettenCount){
4Af(4th letter of Z.Word is 2 vowel){
vonelCount = voxelcount + 1
}
isied
}
eturn(vonelcount)
End vCount
if(K.LetterCount == Y.LetterCount){
4F(vCount(X) == veount(¥))¢
count = count + 1
AF(K.LettenCount I+ Y.LetterCount){
Af (wCount (x) == vCount(Y)){
count = count + 1
y
correct answer
Af(K.LetterCount == ¥.Lettercount){
AF(vcount(x) != vcount(Y)){
count = count +2
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignments-it-madras!
arr8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
FOL LetterCount
AF(wCount(x) I= veount(¥))¢
count = count +2
}
The following pseudocode is executed using the “Scores” dataset. The variables M, P and C store the
number of students in Mathematics, Physics and Chemistry clubs respectively.
M=@, P=0,C=08
while(Table 1 has more rows){
Read the first row X in Table 1
subject = naxSubject (x)
if(K. subject > 98){
if(subject == “Mathenatics"){
Memea
>
AeCsubject == "Physies"){
Pepya
}
Af (subject == *Chemistry"){
cxcea
+
)
Nove X to Table 2
}
Procedure maxSubject(2)
if(2-Chenistry > 2.Mathenatics){
if(2.Chemistry > Z.Physics)(
eturn(*Chomistry")
>
elect
return(*Physics*)
>
else
if(Z.Mathematics > Z.Physics){
eturn("Mathenatics")
+
else
return("Physics*)
>
End maxSubjoct
Which club can a student join if he/she gets 91 marks in all three subjects?
Physics,
Chemistry
tps:graedasignments gh ole. neek-4-graded-asignments-itmacras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Mathematics
The student cannot join any club
Can a student join more than one club ?
‘Yes, if the student has scored more than 90 marks in at least two subject,
Yes, if the student has scored more than 90 marks in Mathematics and Chemistry
Yes, if the student has secured more than 90 marks and the same marks in Mathematics and Chemistry
No, a student cannot join more than one club
he given pseudocode is executed using the “Shopping Bills” dataset. frac stores the ratio of the number of customers who
purchased both “Soap” and “Facewash” to the number of customers who purchased “Facewash”, Choose the correct code
fragment to complete the pseudocode. (Assume there is at least one customer who has purchased “Facewash”)
Count = 8, bCount = @
while(Pile 1 has more cards){
Read the top card X in Pile 1
= Fall the code *
Move X to Pile 2.
}
frac = bCount / Count
Procedure isitem (Y, A)
C= False
while(Card Y has more itens) (
Read an item Z from ItenList of card ¥
Lf(Z.Ttem == A){
C= True
t
Renove Z fron Ttenlist of ¥
}
return(c)
End istten
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignments-it-madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
sf(isTtem(X, “Facewash”)) (
‘Count = acount + 1
?
SF (sTtem(X, “Soap”)){
beount = bCount + 2
?
Af (Isttem(X, “Soap”)){
beount = bCount + 2
Af(isTtea(X, “Facenash")){
imCount = mount + 1
}
Af(isTtem(X, “Facewash”) and isttem(X, “Soap")){
imcount = mCount + 1
count = bCount + 1
if (isTtem(X, “Facewash”))(
Count = acount + 1
if (isttem(x, “Soap”)){
bCount = bount + 2
y
y
correct answer
8. The following pseudocode is executed using the “Olympics” dataset, At the end of the execution, A, Band C store the
number of pairs of players from the same nation who have won same medal in different year.
sme that one player has
won only one medal. Choose the correct code fragment(s) to complete the pseudocode. It is a Multiple Select
Questions(MSQ)
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignments-it-madras! ter8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Ase, B=0,C=0
while(Table 1 has more rows){
Read the first row X in Table 1
if (K.Medal == "Gold" ){
Move X to Table 2
}
if (K.Medal == "Silver"){
Move X to Table 3
)
AF(K.Medal ~~ "Bronze*){
Move X to Table 4
?
‘A= similarPlayers(Table 2)
8 = similarPlayers(Table 3)
C= similarPlayers(Table 4)
Procedure sinilarPlayers(Table 11)
D-0
while(Table T1 has more rows){
Read tho first row V in Table T2
Move ¥ to Table 12
while(Table Ti has more rows)(
Read the first row Zin Table TL
Move Z to Table 13
* FALL the code *
}
Move all rous fron Table T3 to Table TL
}
eturn(D)
End similarPlayers
4f(Y.Natdonality -- Z.Nationality) (
if(W.Year I= 7.Year){
DeDea
}
correct answer
i#(¥.Year I= 2.Year){
LFV Nationality
D=b+1
2.Nationality){
}
correct answer
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignments-it-madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
if(V.Year I= 2.Year and Y.Nationality == Z.Nationality)
p=p+a
y
correct answer
Af(Y.Year = Z.Year or Y.Natlonality
D=pe2
2.Natlonality)
The following pseudocode is executed using the “Words” dataset.
A=0,8-0
P = True, Q = False
while(Table 1 has more rows){
Read the first row X in Table 1
i F(X.PartofSpeech == “Adjective” and P){
P= False
Q = True
t
LF(K.PartOfSpeech == "Noun" and Q){
B=B+i
,
else(
iF(not Q){
AzAsL
y
y
if(X.Woré ends with a full stop){
P = True
Q= False
}
Move X to Table 2
}
9. What will A represent at the end of execution?
Number of words after the first noun in every sentence which are not adjectives
Number of words which appear before the first adjective in every sentence
Number of words other than nouns which appear before the first adjective in every sentence
Number of words after the first adjectives in every sentence which are not nouns
10. What will B represent at the end of execution?
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignments-it-madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Number of nouns after the second adjective in every sentence
Number of nouns before the second adjective in every sentence
Number of nouns before the first adjective in every sentence
‘Number of nouns after the first adjective in every sentence
Week-4, Graded Assignment
Question 1 [4 Marks]
Statement
For which of the following situations is a nested loop needed? Assume that no procedure is used. Itis a
Multiple Select Question (MSQ)
Options
(a)
To find the number of authors who have written a book in "French in 2007 from the “Library” dataset.
(b)
To find the number of pair of students who have scored the same Physics marks from the “Scores” dataset
(c)
To find the number of players who have won the medal in "Wrestling" from the "Sports” dataset,
(a)
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignments-it-madras! sor78129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
To find the number of students with at least two vowels in thelr name from the "Scores"
Answer
(b), (d)
Solution
We will check each and options one by one:
Option (a): This requires only one loop.
Option (b): For finding the pair of students who scored the same Physics mark requires nested loop. The
‘outer loop fix one of the student's mark and the inner loop compares with remaining student's mark.
Option (c): This requires only one loop,
Option (a): It eaquires nested loop to find the number of students with at least two vowels in their name:
{from the "Sports" dataset. The outer loop iterates through the each student's name and the inner loop will
iterate through the each letters of the student's name.
Therefore the correct options are (b), (d).
Question 2 [4 Marks]
Statement
The following pseudocode is executed using the "Scores" dataset. Assume that length(x) is a procedure that
returns the number of letters present in a word x. What will A represent at the end of the execution?
A
while(Table 1 has more rows){
Read the first row X in Table 2
=a, B= True
c= X.Name
while(s <= Lengtn(c)){
Af(ith letter of ¢ is a vowel){
8 = False
y
dedea
208)
Asad
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras! wer8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Nove X to Table 2
Options
(a)
Number of students whose names are without vowels
(b)
Number of students whose names have at most one vowel
(c)
Number of students whose names have exaclly one vowel
(a)
Number of students whose names have at least one vowel
Answer
@)
Solution
In this pseudocode nested while loop is used in which outer loop iterates through each student. Variable Cstores the name
of the student, procedure length(x) counts the number of letters present in C and the
inner loop iterates through the each letter of C. The variable B is updated to False whenever a vowel is.
found in a word, Therefore variable A counts those words which do not have vowels. Therefore the correct
option is (a).
Question 3 [4 Marks]
Statement
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras! seer8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
The following pseudocode is executed using the ‘Library’ dataset. What will C represent at the end of the
‘execution? Assume that there is only one row corresponding to each author in the "Library" dataset.
c
while(Table 1 has more rows){
Read the first row X in Table 1
Nove X to Table 2
while(Table 1 has ore rows){
Read the first row ¥ in Table 1
Af (Findpair(x, ¥))(
cacel
y
Move Y to Table 3
Move a11 rows fron Table 3 to Table 1
Procedure findPair(x, ¥)
Af(X.Genre == Y.Genre and X.Language |= Y.Language)<
return(True)
elset
return (False)
End findPair
Options
(a)
Number of authors who have written different genre books in same language
(b)
Number of pairs of authors who have written different genre books in same language
(c)
Number of authors who have written same genre books in diferent language
(a)
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Number of pairs of authors who have written same genre books in different language
Answer
@
Solution
In this pseudocode nested while loop is used which find pairs of authors. Now we investigate the
psoudocode closely. The variable C is incremented whenever procedure findPair(X, ¥) returns True. The
procedure findPair(X, Y) retums True for pair of authors who authored in the different language but same
genre . Therefore, variable C counts the number of pairs of authors who have written books in different
language in same genre, Therefore option (d) is correct
Question 4 [5 Marks]
Statement
Two words are said to be special if they full following conditions:
Number of vowels are same in bath the words
Number of consonants are not same in both the words
The given pseudocode is executed using the "Words" dataset, The variable count in the given pseudocode
counts the number of special pairs, Choose the correct code fragment(s) to complete the pseudocode,
count = @
while(Table 1 has more rows){
Read the first row X in Table 2
Move X to Table 2
while(Table 1 has more rows){
Read the first row ¥ in Table 1
FALL here
Move Y to Table 3
Move all rows fron Table 3 to Table 1
Procedure vcount(2)
vouelCount = 0, i = 2
while(i <= Z.Lettercount)(
Af(ith letter of Z.word is a vowel)
vowelcount = vowelCount + 1
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!
sanr8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
)
bedea
retuen(vowelCount)
nd yCount
Options
(a)
F(X. Lettercount
if vCount(X) == vCount(Y))
count = count +2
(b)
Af(K.Lettercount I= Y,LetterCount) {
EF (vCount(x) == veount(Y))(
‘count = count 42
(c)
sf (X.Lettercount == Y.Lettercount)
Lf(vCount(x) f= veount(¥))(
count = count + 4
(a)
F(X.Lettercount {= Y.Lettercount) {
EF vCount(X) I= vCount(¥))¢
‘count = count +3
y
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
>
Answer
()
Solution
The given pseudocode counts the number of special pairs. We need to find the pair of words have same
number of vowels and different number of consonants. This is possible only when the letter count of both
the words are not same. Let us check the options one by one.
Option (a) : This options checks if the letter count of both the words are same and if same the number of
‘vowels should also be same. This means that number of consonants will also be the same. Hence, this is an
incorrect option.
Option (b) : This options checks ifthe letter count of both the words are not same and if same the number
of vowels be same, This means that number of consonants will not be the same, This is the correct option.
Option (c) : This options checks if the letter count of both the words are same and if same the number of
vowels should not be same, This does not satisfy the condition of the question. Hence, this is an incorrect
option.
Option (d) : This options checks ifthe letter count of both the words are not same and if same the number
of vowels are also not same. This does not satisfy the condition of the question. Hence, this is an incorrect
option.
Question (5-6)
Statement
The following pseudocode is executed using the "Scores" dataset. The variables M, P and C store the
number of students in Mathematics, Physics and Chemistry clubs respectively.
Ne, P-0,c-8
whille(Table 1 has more rows
Read the first row X in Table 2
subject = maxSubject (x)
AF (K. subject > 90)(
if (subject == “vathenatics”){
Nema
x
if (subject
Pepa
“Physies"){
x
if (subject
c-ced
“chemistry")<
y
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Nove x to Table 2
»
Procedure saxsubject(Z)
if (Z.chemistry > Z.Mathenatics){
Af (Z.Chemistry > Z.Physics){
return("chenistry”
x
elset
return("Physics")
y
else
Af (Z.Mathematics > Z.Physies)(
return("Mathematics")
y
elset
return("Physics")
x
End maxsubject
Questions 5 [5 marks]
Statement
Which club can a student join if he/she gets 91 marks in all three subjects?
Options
(a)
Physics
(b)
Chemistry
(c)
Mathematics
(a)
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!
ser8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
The student cannot join any club
Answer
@)
Solution
The joining of a club will depend on the retum value of the procedure maxSubject. In this question itis
given that a student got 90 marks in all subjects. The procedure maxSubject will be called. In the procedure
firstly Chemistry marks is compared with Mathematics marks. Since Chemistry marks is same as
Mathematics marks, the i-block sets to be False and flow of the code wil go to else-block. Inside the else-
block, Mathematics marks is compared with Physics marks. Since Mathematics marks is same as Physics
marks, the iF-black sets to be False and flow of the cade will go to else-block and "Physics" will be relured.
Now the value stored in variable subject is "Paysics", Since Physics marks is which is more than 90, variable
will be incremented. Therefore a student who will get more Gand same marks in all subjects. He/she will
join Physics club. The correct option is (a.
Question 6 [4 Marks]
Statement
Can a student join more than one club ?
Options
(a)
Yes, if the student has scored more than 90 marks in at least two subject
(b)
‘Yes, ifthe student has scored more than 90 marks in Mathematics and Chemistry
(c)
Yes, ifthe student has secured more than 90 marks and the same marks in Mathematics and Chemistry
(a)
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
No, a student cannot join more than one club
Answer
@
Solution
From the previous question we saw that joining of a club depends upon the return value of procedure
‘maxSubject and it returns only one value which is further compared in the main part of the code, Hence a
student can join only one club if he/she gets more than 90 marks in thal subject. Hence the correct option is
@
Question 7 [4 Marks]
Statement
The given pseudocode is executed using the “Shopping Bills” dataset. frae stores the ratio of the number of
customers who purchased both "Soap" and "Facewash’ to the number of customers who purchased
"Facewash’, Choose the correct code fragment to complete the pseudocode. (Assume there is at least one
customer who has purchased "Facewash’).
count = 0, bCount = @
while(Pile 1 has sore cards){
Read the top card X in Pile 1
+ Fill the code *
Move X to Pile 2.
frac = bCount / Count
Procedure isiten (Y, A)
c= False
vhile(Card ¥ has nore itess){
Read an Stem Z from ItemList of card Y
Af (Z.Ttem == A)(
= True
y
Renove Z from TtenList of ¥
return(e)
End isrten
Options
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!8129124, 9:18 AM
(a)
Le(isttem(x, “Facewash”))(
rnCount = mCount + 1
?
AF(isttem(x, “Soap"))(
beount = beount + 2
?
(b)
Ae(isteem(X, “Soap”))¢
{Count +2
mm(X, “Facewash")){
count = mCount + 2
(c)
AF(AsTtem(X, “Facewash”) and isttem(X, “Soap")){
incount = mcount +1
count = BCount + 2
(a)
if(Asrtem(x, “Facewash”)){
Incount = mount + 1
if(Asttem(X, “Soap”)){
beount = bcount + 1
Answer
@
Solution
ritps:lgradedassignments github ile week-4-graded-assignments-ittmadras!
CT Week 4 Graded Assignments IT Madras
2ov278129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Procedure isltem (Y, A) returns True if item A is there in the item list of card Y otherwise returns False. As
|we are trying to find the ratio of customers who purchased both Soap and Facewash to the number of
customers who purchased Facewash, Count should stores the number of customers who buy Soap and
Facewash together and mCount should store the number of customers who buy Facewash.
Option a. bCount stores the number of customers who buy Soap (irrespective of the customers who buy
Facewash or nat). This is not the situation we want.
Option b. mCount stores the number of customers who buy Facewash only i they buy Soap. This is not the
situation we want,
Option c. bCount and mCount are always same and stores the number of customers who buy both Soap
and Facewash. This is not the case here.
Option d. mCount stores the number of customers who have bought the Facewash and bCount stores the
number of customers who buy Soap only if they buy Facewash. This the required condition. Therefore,
option d is correct.
Question 8 [4 Marks]
Statement
The following pseudocode is executed using the “Olympics” dataset. At the end of the execution, A, B and Cstore the
number of pairs of players from the same nation who have won same medal in different year.
‘Assume that one player has won only one medal. Choose the correct code fragments) to complete the
pseudocode. It is a Multiple Select Questions(MSQ)
B= 0, C28
while(Table 1 has more rows){
Read the first row X in Table 1
if(X.Medal == "Gold"){
Move X to Table 2
Sf(X.Medal == “silver"){
Move X to Table 3
Af(X.Medal <= "Sronze"){
Move X to Table 4
»
A = similarPlayers(Table 2)
B = sinilarPlayers(Table 3)
C= similarPlayers(Table 4)
Procedure similarPlayers(Table T1)
b-o
uhile(Table Ti has wore rows){
Read the first row ¥ in Table T1
Move Y to Table T2
while(Table TA has more rows) {
Read the first row Z in Table Ta
Move Z to Table T3
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras! aur8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
y
Move all rows from Table 13 to Table T
return()
End similarPlayers
Options
(a)
AF (V.Nationality == Z.Nationality){
Af(Y.Year I= Z.Year){
D=Dea
>
(b)
Ae(¥.¥ear I= Z.¥ear){
2.Netionality) (
?
(c)
Ae(¥.Vear = Z.Year and ¥.Nationality =~ Z.Nattonal
D-Der
?
(a)
Af(V.Vear |= Z.Year or Y.Nationality == Z.Nationality)
b=be2
?
ritps:lgradedassignments github ile week-4-graded-assignments-ittmadras!
zarer8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Answer
(@), (0) . (¢)
Solution
The above pseudocode is executed on the “Olympics dataset. At the end of the execution, variables A, Band C store the
‘number of pairs of players from the same nation who have won same medal in different
year. The pseudocode has to be completed with the correct code fragment from the given options. Let us
‘observe the given pseudocode.
In the main part of the pseudocode, three bins are created based on the medal won by the player. The first
bin ie. Table 2 stores the players who won the medal in "Gold”, the second bin ie. Table 3 stores players
ho won the medal in "Sliver" and the third bin i. Table 4 stores the players who won the medal in
onze". Then procedure similarPlayers is called separately with created bins as an input (argument). The
procedure similarPlayers contains a nested while loop. This nested while loop should create pairs of players
‘rom the created bins as mentioned in the problem. The condition for checking the same nation and
different year of winning should be in the inner while loop of the procedure similarPlayers. The missing
code fragment can be written as:
Ae(¥.Year I= Z.Year and Y.Nationality
D=p+n
Z.Nationality)
>
Here two conditions are connected with word “and”, which could be converted in two conditions using
nested loop which is given in option a and b. Therefore, options a, b, and c are correct.
Question (9-10)
Statement
The following pseudocode is executed using the Words" dataset,
eB.
False
while(Table + has more rows){
Read the first row X in Table 1
if (X.PartoFspeech == “Acjective” and P)(
P = False
Q= True
3 (X.Partofspeech
Noun” and Q){
BeBe
else:
Af(not OE
AeRed
x
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!
2ar78129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
Af(%.Word ends with a ull stop)(
P= True
Q = False
Move X to Table 2
,
Question 9 [4 Marks]
Statement
What will A represent at the end of execution?
Options
(a)
Number of words after the first noun in every sentence which are not adjectives
(b)
Number of words which appear before the first adjective in every sentence
(c)
Number of words other than nouns which appear before the first adjective in every sentence
(a)
Number of words after the first adjectives in every sentence which are not nouns
Answer
©)
Solution
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras! pant8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
The given pseudocode is executed on the "Words" dataset. The increment of variable A depends on the
variable Q. Variable Ais incremented for False value of Q. Since it check for ‘not Q’. The variable Q is set as
False intially and set to True when an adjective is found. Hence variable A will count the number of words
which appear before the first adjective in every sentence.
Question 10 [4 Marks]
Statement
What will B reprosent at the end of execution?
Options
(a)
Number of nouns after the second adjective in every sentence
(b)
Number of nouns before the second adjective in every sentence
(c)
Number of nouns before the first adjective in every sentence
(a)
Number of nouns after the first adjective in every sentence
Answer
@
Solution
The increment of B depends on Q even though part of speech of a word is adjective. Q is initially False and
set to be True when an adjective is found. Hence B will count number of nouns after the first adjective in
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras!8129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
every sentence.
Name
[noe |
Email
[ena |
Message
Message
Send
eek 4 Graded Solutions PDF
Leave a Reply
Your email address wil nat be published. Required fields are marked *
Name *
Email *
Website
Comment *
hntps:fgradedassignments github jolt week--graded-a
2sr278129124, 9:18 AM CT Week 4 Graded Assignments IT Madras
O Save my name, email, and website in this browser for the next time | comment.
Post Comment
GRADED ASSIGNMENTSIITMADRAS ACT WEEK 1 GRADED ASSIGNMENTS IIT MADRAS
Tag}
(CT WEEK 4 GRADED ASSIGNMENTS IT MADRAS
FOR WHICH OF THE FOLLOWING SITUATIONS IS A NESTED LOOP NEEDED? ASSUME THAT NO PROCEDURE IS USED. IT
IS A MULTIPLE SELECT QUESTION
GRADED ASSIGNMENTS IITMADRAS NUMBER OF VOWELS ARE SAME IN BOTH THE WORDS,
‘THE FOLLOWING PSEUDOCODE IS EXECUTED USING THE “OLYMPICS” DATASET. AT THE END OF THE EXECUTION
‘TWo WORDS ARE SAID TO BE SPECIAL IF THEY FULFILL FOLLOWING CONDITIONS:
WEEK 4 GRADED ASSIGNMENTS WHAT WILL B REPRESENT AT THE END OF EXECUTION?
Copyright © 2023 IITM Students Community All Rights Reserved.
Privacyand Terms Privacy Policy REFUND POLICY Contact Us
htps:lgradedassignments.gthubiolet-wesk-4-graded-assignmentsit- madras! amen