Basics of Algorithm
if/if-else statements
For-loop
While-loop
Nested loop
100

What do we call the initial data that goes into an algorithm?

What is input?

100

What is the primary purpose of an if-statement in programming?

 What is evaluate conditions and execute code when true or false?

100

What are two common kinds of loops?

What is for-loops and while-loops?

100

Is a While-loop a counter-based loop or a condition-based loop?

What is Condition?

100

What is a nested loop?

What are loops within loops?

200

What is the step-by-step method used to solve problems in computing called?

What is an algorithm?

200

How is a single-line if-statement structured?

What is the condition and instruction appearing on the same line?

200

What is each repetition of the block of instructions inside the for-loop called?

What is iteration?

200

When does the while loop end?

What is when the condition is False?

200

In nested loops, what are the outer and inner loops?

What is the outer loop controls the inner loop(s)?

300

What is the difference between pseudocode and a programming language?

What is pseudocode which is not meant for execution, while programming language is meant to be executed with syntax?

300

What in an if-else statement is executed if the condition is false?

What is Else?

300

What is the value of “sum” after the second iteration? 

sum:= 0 

For p= 4 to 10 

sum: = sum + p 

End-for

What is 9?

300

product:= 1

count:= 6

While (count>0)

    product := product*count

    count := count -2

End- while
What is the value of "product" after the second iteration?

What is 12?

300

Consider the following nested loops:

for i in range(3):

      for j in range(2):

      print(i, j)

How many times will the ‘print’ statement be executed in total?

What is 6 times?

400

If an algorithm has a Return statement in the middle, what happens?

What is algorithm stops executing at that point and outputs specified value?

400

What If the condition is true in an if-else statement, what happens to the "else" code? 

What is Skipped?

400

How many iterations will the for-loop execute? 

sum:= 0 

For p= 4 to 10 

sum: = sum + p 

End-for

What is 7?

400

product:= 2

count:= 6

While (count>0)

    product := product*count

    count := count -2

End- while

What is the final value of "product" after the while-loop has completed all its iterations?

What is 24?

400

In a nested loop structure, what is the significance of the inner loop's execution regarding the outer loop?

What is the inner loop is executed for each iteration of the outer loop?

500

r:= u*2, s:= v+3, u:=z ÷ 2, t:= w-1, q:=s-t, v:=x+2, w:=y*2, p:=q+r^2, x:=z-1, z:=10, y:= z÷2

What is 105?

500

What is the value of x and y after the line of codes is run?  

x = 10 

y  = 5 

if(x< y): 

Min = x 

Max = y 

Else: 

Min = y 

Max = x 

End-if  

What is min = 5 and Max = 10  

500

What is the final value for the “sum” after executing the for-loop?

sum:= 0 

For p= 4 to 10 

sum: = sum + p 

End-for

What is 49?

500

product:= 2

count:= 6

While (count>0)

    product := product*count

    count := count -2

End- while

How many iterations will the while-loop execute?

What is 3 or execute three iterations?

500

Given the following nested loop:

for i in range(2):

for j in range(3):

for k in range(4):

print(i, j, k)

How many times will the ‘print’ statement be executed in total?

What is 24 times?

M
e
n
u