11th Standard Syllabus & Materials
11th Standard
TN 11th Tamil இயற்கை வேளாண்மை,சுற்றுச்சூழல் -செய்யுள் - மனோன்மணீயம் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil என்னுயிர் என்பேன் -துணைப்பாடம் - இசைத்தமிழர் இருவர் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மொழி கலை -செய்யுள் - ஒவ்வொரு புல்லையும் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - இலக்கணம் - பகுபத உறுப்புகள் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - துணைப்பாடம் - வாடிவாசல் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - செய்யுள் - குறுந்தொகை Important Questions And Answers Study Material - QB365 Set A

Published on: 14/12/2019
Control Structure in JavaScript
Download Tamil Nadu 11th Standard Computer Applications question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Applications Test

1.
Write script for the following criteria.
2.
What are the functions of the for loop parts?
3.
4.
Write the syntax for else-if statement.
5.
What is if statement and write its types?
6.
Which of the following statement is an alternate to using if-else structure in Javascript?
do-while
else if
switch
if
7.
Which of the following statement to specify a new condition if the first condition is false?
if-else
else-if
if
for
8.
Which of the following statement is the fundamental control statements?
if-else
else-if
switch
none of these
9.
How many forms of if statement in Javascript?
3
2
4
7
10.
Which of the following is not a braching statement in Javascript?
if
if-else
else if
for
11.
What is the output of the following html code?
12.
What is branching statement?
13.
How the switch statement evaluates the case structure?
14.
Write the syntax of if-else statement?
15.
What is the use of branching statements?
16.
Explain while loop with suitable example.
17.
Write a Javascript to display the given number is words using switch-case (Number between only 1 and 5)
18.
Explain the working of do while loop in Javascript with an example?
19.
Explain the execution of while loop with an example?
1.
| MARK | GRADE |
| > 90 | 1 - OUTSTANDING |
| 71-90 | 2 - EXCELLENT |
| 51-70 | 3 - GOOD |
| 41-50 | 4 - SATISFACTORY |
| < = 40 | 5 - POOR |
CODE:
< Html >
< Head >
< Title >Program - To test witch command in JavaScript < /Title >
< /Head >
< Body >
< script language="javascript" type="text/ javascript" >
var grade=0;
var marks=prompt("Please enter your marks/100:","0' };
if(marks >90) ,
{grade = 1; }
else if(marks>70)&&(marks<=90) {grade=2;}
else if(marks>50)&&(marks<=70) {grade=3; }
else if(marks>40)&&(marks<=50) {grade=4; } .
else {grade=5; }
switch(grade)
{
case 1:
document.write("Your Grade is Outstanding ..' };
break;
case 2'
document.write("Your Grade is
Excellent..'');
break;
case 3:
document. writef'Your Grade isGood..'');
break;
case 4:
document.write("Your Grade is Satisfectory ..'');
break;
default:
document.write("Your Grade Poor and have to re-appear Exam..'');
}
< /script >
< /Body >
< /Html >
2.
The for structure within parenthesis there are three parts each separated by semicolon.
They are:
i) The first part of the loop initialize a variable which is also called as control variable.
ii) In most case the control variable is declared as well as initialized.
iii) The second part isthe conditional statemem that determines how many times the loop will be iterated.
iv) The third and final part determines how the value of control variable is changed (Incremented/Decremented)
3.
4.
if (expression)
{
// Execute code block #1
}
else if (expression)
{
// Execute code block #2
}
else if (expression)
{
// Execute code block #3
}
else
{
// if all else fails, execute block #4
}
5.
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;
}
Types of if statement:
if else statement
else if statement
nested if statement
6.
(c)
switch
7.
(b)
else-if
8.
(d)
none of these
9.
(b)
2
10.
(d)
for
11.
< html >
< head >
< title > Type casting < /title >
< /head >
< body bgcolor=orange >
< Font size = 7 >
< script language = "javascript" type = ''text! javascript ">
var x = 6 + parsent('3');
document.write (x);
< /script >
< /Font >
< /body >
< /html >
12.
Branching Statements:
1. JavaScript supports branching statements which are used to perform different actions based on different conditions.
2. Branching is a transfer of control from the current statement to another statement or construct in the program unit.
3. A branch alters the execution sequence.
13.
1. The switch statement begins by evaluating an expression placed between parenthesis, much likethe if statement.
2. The result compared to labels associated with case structure that follow the switch statement.
3. If the result is equal to a label, the statements in the corresponding case structure are executed.
14.
if (expression)
{
statements if true
}
else
{
statements if false
}
15.
1. JavaScript supports branching statements which are used to perform different actions based on different conditions.
2. Branching is a transfer of control from the current statement to another statement or construct in the program unit.
3. A branch alters the execution sequence .
16.
while loop
In JavaScript while loop is 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
}
Example:
< Html >
< Head >
< Title >P rogram - To test while
statement in JavaScript < /Title >
< /Head >
< Body >
< script language="javascript" type="text/
javascript" >
document.write("< h2 > Using while
Statement < /h2 >'');
var no2=0;
whlle(no2 <=5)
{
document. write( no2+" ");
no2=no2+1;
}
< /script >
< /Body >
< /Html >
To execute a while statement, the interpreter first evaluates expression. If the value of the expression is true the interpreter executes the statement and repeats, jumping back to the top of the loop and evaluating expression again. In the above example let us see how the while command is executed,
1. Initial value of the variable no2 is set to 0.
2. The expression in the while statement is executed.
3. If the condition is true then body of the loop will be executed once otherwise body of the loop will be skipped and control will jump to next statement to end of the loop.
4. Then the. value of the control variable is executed and control jumps to condition again go to step 3.
17.
< Html >
< Body >
< script language="Javascript" type="text/ javascript" > .
var N=0;
var N = promt ("Enter the Number","0");
switch (N)
{
case 1 :
document.write ("One");
break;
case 2 :
document.write ("Two");
break;
case 3 :
document.write ("Three");
break;
case 4 :
document.write ("Four");
break;
case 5 :
document.write ("Five");
break;
default:
document.write ("Invalid! Enter between 1 and 5");
}
< /script >
< /body >
< /Html >
18.
The do ..while loop is like a while loop, except that the loop expression is tested at the end of the loop rather than at the beginning. This means that the body of the loop is always executed a,t least once. The syntax is:
do
{
body of the loop
} while (expression);
An important difference between while and do ..
while statement is in the do ..while loop
body of the loop always executed at least once before the condition can be executed. In a while loop, first condition will be evaluated and then only based on the result of the condition the body of the loop will be executed or not.
Using do ..while loop
< Html >
< Head >
< Title >Program - To test do ..while statement in
JavaScript < /Title >
< /Head >
< Body >
< script language="javascript" type="text/ javascript" >
document.write("< h2 > Using do ..while
Statement < /h2 >");
var no2=0; do
{
document. write(no2+"");
no2=no2+2;
}while(no2< = 10);
< /script >
< /Body >
< /Html >
19.
In JavaScript 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
}
Using while loop:
< Html >
< Head >
< Title >Program - To test while statement in
JavaScript < /Title >
< /Head >
< Body >
< script language=;"javascript" type="text/ javascript" >
document.write("< h2 > Using while Statement < /h2 >");
var no2=0; while(no2< =5)
{
document. write(no2+"");
no2=no2+1;
}
< /script >
< /Body >
< /Html >

To execute a" while statement, the interpreter first evaluates expression. If the value of the expression is true the interpreter executes the statement and repeats, jumping back to the top of the loop and evaluating expression again. In the above example let us see how the while command is executed,
1. Initial value of the variable no2 is set to 0
2. The expression in the while statement IS executed.
3. If the condition is true then body of the loop will be executed once otherwise body of the loop will be skipped and control will jump to next statement to end of the loop.
4. Then the value of the control variable is executed and control jumps to condition again go to step 3.
11th Standard Syllabus & Materials
11th Standard
TN 11th Tamil பீடு பெற நில் - செய்யுள் - காவடிச்சிந்து Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - உரைநடை - மலை இடப்பெயர்கள் : ஓர் ஆய்வு Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மாமழை போற்றுதும் - துணைப்பாடம் - யானை டாக்டர் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மாமழை போற்றுதும் - செய்யுள் - ஐங்குறுநூறு Important Questions And Answers Study Material - QB365 Set A
Tamilnadu Stateboard 11th Standard Subjects

Maths

Commerce

Economics

Biology

Business Maths and Statistics

Accountancy

Computer Science

Physics

Chemistry

Maths

Biology

Economics

Physics

Chemistry

History

Business Maths and Statistics

Computer Science

Accountancy

Computer Applications

History

Computer Technology

Commerce

Computer Applications

Computer Technology

Tamil

English

French
Tamilnadu Stateboard Standards