SaraNextGen.Com

Text Book Back Questions and Answers - Chapter 15 Control Structure in JavaScript 11th Computer Application Guide Samacheer Kalvi Solutions - SaraNextGen [2024-2025]


Updated On May 15, 2024
By SaraNextGen

Samacheer Kalvi 11th Computer Applications Solutions Chapter 15 Control Structure in JavaScript - Text Book Back Questions and Answers

I. Choose The Correct Answer

Question 1.
Which conditional statement is used to transfer control from current statement to another statement? (LOT)
(a) Branching
(b) Sequencing
(c) Looping
(d) Iterating
Answer:
(a) Branching

Question 2.
……………………. statement can be used as alterative to multiple if-else statement (LOT)
(a) while
(b) if
(c) else-if
(d) switch
Answer:
(d) switch

Question 3.
Which statement in switch case is used to exit the statement once the appropriate choice is found? (MOT)
(a) exit
(b) default
(c) case
(d) break
Answer:
(d) break

Question 4.
Which of the following is not a looping statement? (LOT)
(a) switch
(b) while
(c) do-while
(d) for
Answer:
(a) switch

Question 5.
Which part of the loop statement determines the number of times, the loop will be iterated? (MOT)
(a) First
(b) Second
(c) Third
(d) Final
Answer:
(b) Second

Question 6.
Which of the following is not a branching statement? (LOT)
(a) Loop
(b) If-else
(c) Switch
(d) For
Answer:
(d) For

Question 7.
What will be the output for the following snippet? (HOT)
For (var n=0; n<10; n+1)
{
if (n==3)
{
break;
}
document write (n+ “
”);
}
(a) 0 1 2
(b) 0 1 2 3 4
(c) 0 1 2 3 4
(d) 0, 1, 3
Answer:
(a) 0 1 2

Question 8.
In which loop the condition is evaluated, before executing a statement? (MOT)
(a) while
(b) do while
(c) break
(d) continue
Answer:
(a) while

Question 9.
The …………………… statement is especially useful when testing all the possible results of an expression? (LOT)
(a) while
(b) do while
(c) switch
(d) if
Answer:
(a) while

Question 10.
In the ……………………. loop, body of the loop always executed at least once before the condition is checked? (LOT)
(a) for
(b) while
(c) if
(d) do while
Answer:
(d) do while

Question 11.

 

Question 2.
Explain switch case statement with example?
Answer:
Java Scripts offers the switch statement as an alternate to using if…else structure. The switch statement is especially useful when testing all the possible results of an expression. The syntax of a switch structure as the following: switch(expression)
{
case label1:
statements 1;
break;
case label2:
statements2;
break;
case labeln;
statements – N;
break;
default:
statements;
}

Question 3.
Write the output for the following program?
Answer:




for statement
 

 

 

 

Question 4.
Write a Java Script program using while statement to display 10 numbers?
Answer:

 

 


Display 10 Numbers in Javascript

 

 

 

 

 

 

 

Additional Questions and Answers

 

 

 

 

 

I. Choose The Correct Answer

Question 1.
The simple if construction, no special processing is performed when the condition evaluates to false?
(a) if else
(b) switch
(c) nested if
(d) if
Answer:
(a) if else

Question 2.
The statement begins by evaluating an expression placed between parenthesis, much like the if statement?
(a) break
(b) default
(c) continue
(d) switch
Answer:
(d) switch

Question 3.
……………………… is can be at the end of a switch structure if the result of the expression that do not match any of the case labels?
(a) break statement
(b) switch structure
(c) continue statement
(d) default structure
Answer:
(d) default structure

Question 4.
The loop initialize a variable which is also called as control variable ………………………..
(a) Third
(b) First
(c) Second
(d) All the above
Answer:
(b) First

Question 5.
……………………… statement is executed, the current iteration of the enclosig loop is terminated and the next iteration begins?
(a) switch
(b) break
(c) continue
(d) if
Answer:
(c) continue

Question 6.
The purpose of a ………………………. is to execute a statement/block of’statement repeatedly as long as an expression is true?
(a) for loop
(b) do while loop
(c) while loop
(d) all the above
Answer:
(c) while loop

II. Short Answers

Question 1.
What is branching statements?
Answer:
Java Script supports branching statements which are used to perform different actions based on different conditions. Branching is a transfer of control from the current statement to another statement or construct in the program unit. A branch alters the execution sequence.

Question 2.
Write the syntax of the if else statement?
Answer:
if (expression)
{
statements if true
} else
{
statements if false
}

Question 3.
Write a short note on continue statement?
Answer:
The continue statement will skip back to the loop condition check. When the continue statement is executed, the current iteration of the enclosing loop is terminated, and the next iteration begins.

III. Explain in Brief

Question 1.
What is while loop?
Answer:
In Java Script while loop is another most basic loop. The purpose of a while loop is to execute a statement /block of statement repeatedly as long as an expression is true.
The while statement creates a loop that executes a specified statement as long as the test condition evaluates to true. The condition is evaluated before executing the statement.
The syntax is:
while (condition)
{
body of the loop
}

Question 2.
Write the example of break statement?
Answer:
The break statement will terminate the loop early. For example, for (var n = 0; n < = 10; n++)
{
if (n == 5)
{
break;
}
document. write(n+”
”);
}

Question 3.
What are the parts of for loops?
Answer:

  1. The first part of the loop initialize a variable which is also called as control variable. In most case the control variable is declared as well as initialized.
  2. The second part is the conditional statement that determines how many times the loop will be iterated.
  3. The third and final part determines how the value of control variable is changed (Incremented/Decremented).

IV. Explain in Detail

Question 1.
Explain if statement with suitable example?
Answer:
The if statement is the fundamental control statement that allows JavaScript to make decisions to execute statements conditionally. This statement has two forms. The form is for only true condition. The syntax is
if (condition)
{
True block;
}
In the if form, condition contains relational/logical expression is evaluated. If the resulting value is true the true block is executed. True block may contain one or more than one statement. For example.
Demo to Test if command

 

 


Demo Program – To test if command in JavaScript






The output will be

 

 

Question 2.
Write the output for the following program?
Answer:
Using break statement

 

 


Demo Program – To test Break command in JavaScript

 

 

 

 

 

 

 

 

 

 

 

 

Also Read : Text-Book-Back-Questions-and-Answers-Chapter-16-Javascript-Functions-11th-Computer-Application-Guide-Samacheer-Kalvi-Solutions

SaraNextGen