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
JavaScript Functions
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.
List some pre-defined functions
2.
What is pre-defined function?
3.
Write a note on is NAN ( ) function.
4.
What are the rules followed while defining functions in JavaScript?
5.
What are the two types of functions supports by JavaScript?
6.
Write the syntax of functions.
7.
Write a note on user defined functions.
8.
What is the use of function?
9.
Tabulate some pre-defined functions and its function with an example.
10.
Write a program in JavaScript to find the sum of 10 numbers using function.
11.
Write a program in JavaScript to find the cube of a number using function.
12.
Which library function returns the element that has the ID attribute with the specified value_______.
is NAN ( )
stElementBy ID ( )
getelement By ID ( )
get element ID ( )
13.
The functions parameter lists must be seperated by _______.
comma
dot
semi-colon
colon
14.
The function body enclosed with________.
( )
< >
[ ]
{ }
15.
Which of the following in JavaScripts paprameterized or non-parameterized?
literals
identifies
punctuators
functions
16.
Which of the following is not a library function?
prompt()
script()
write()
is NaN()
17.
Write a JavaScript to create on-line quiz.
18.
Write a program in JavaScript to test isNan( ) Function
19.
Write a JavaScript to find the given value is a number or not Using functions and form.
20.
Write a JavaScript to find sum of two numbers using function.
1.
The following are pre-defined functions in JavaScript.
1. isNaN ( )
2. toUpperCase( )
3. toLowerCase( )
4. length( )
5. alertt( )
6. promptt ( )
7. write( )
2.
Pre-defined functions:
Pre-defined functions are already defined in the JavaScript library which are also called Library functions.
3.
(i) The is NaN ( ) function is used to check whether the given value or variable is valid number.
(ii) This function returns true if the given value is not a number. For example isNaN("12"), is NaN ("A").
4.
The function-name is any valid identifier.
(i) For Example: sum
(ii) The parameter list contains one or more valid variable name.
(iii) Parameter list contains more than one variable then comma must be there between the variable.
(iv) The function body must be enclosed by braces.
5.
JavaScript supports two types functions. They are
(i) Pre-defined or Library Functions.
(ii) User-defined Functions.
6.
The format of a functions definition is
Function function-name(parametets list)
7.
User-defined functions allow the programmer to modularize a program. Most computer programs that solve real-world problems are much large, occupy more space in the computer memory and takes more time to execute. Hence such large programs are divided into small programs called modules.
8.
Functions are used to encapsulate code that performs. a specific task. Sometimes functions are defined for commonly required tasks to avoid the repetition entailed in typing the same statements over and over. More generally, they are used to keep the code that performs a particular job in one place in order to enhance reusability and program clarity.
9.
| Function | Description | Example | Result |
| toUpperCase( ) | Used to convertgiven string into uppercase | x="java" x.toUpperCase( ); | JAVA |
| to Lower Case ( ) | Used to convert given string into lowercase | x="JAVA" x.toLowerCase( ); | java |
| length | Used to find length of the given string | x="JAVA" x.length( ); | 4 |
| parselnti ( ) | Used to convert the given float value into an integer | parselnt(34.234); | 34 |
| parseFloat( ) | Used to convert the given string into a integer | parseInt(34.23"); | 34.23 |
10.
< html >
< body >
< script language = "JavaScript" type "text/ JavaScript" >
var N;
var N = prompt("Enter the N terms", "O");
var x = parse Int(N);
var s = sum(x);
document.write in("The sum of 10 numbers = "+8);
function sum (x)
{
var s = 0;
var s = (x*(x + 1))/2;
return s ;
}
return
< /script >
< /body >
< /html >
11.
Program to find the cube of a number:
< html >
< body >
< script language = "JavaScript" type = "text/ JavaScript" >
var N = window.prompt("Enter the number to find cube" ,"O")',
var x = parse Int(N);
vary s = cube (x);
document, written ("The cube of a number" + x + "is" +s); function cube(m)
{
var s = m*m*m;
returns s ;
}
< /script >
< /body >
< /html >
12.
(c)
getelement By ID ( )
13.
(a)
comma
14.
(d)
{ }
15.
(d)
functions
16.
(b)
script()
17.
HTML CODE
< html >
< head >
< title >On-line Qulze-c/title >
< script type="text/JavaScript":;'\
function checkAnswer ( )
{
var myQuiz = document.getElementByld
("myQuiz'') ;
if . ( document.getElementById("myQuiz'').
elements[O] .checked)
alert("Congratulations, Your Answer is correct'');
else
alert("Your Answer is incorrect, Pleasetry Again'');
}
< /script >
< /head >
< body >
< form id="myQuiz" action="JavaScript:check
Answert ( )" >
< p > Which is not a Programming
Language:. < br >
< input type="radio" name="radiobutton"
value=''Word'' / >
< label > MS-Word< /Iabel >
< input type="radio" name="radiobutton"
value="Cobol" / >
< label > COBOL< /Iabel >
< input type="radio" name="radiobutton"
value="CPP" / >
18.
HTMLCODE
< html>
< title > Example Program to test isNan() Function < title >
< head>
< body.>
< h4 >< u >Example Program to test isNan() Function< /u >< /h4 >
< script language="JavaScript" >
function checknum()
{
var n=documentform1.text1.value;
if(isNaN(n)==true)
{
documentform1.text2.value="Not a
Number: "+n;
}
else
{
documentJorm1.text2.value='1t is
Number: "+n;
}
}
< /scrip t>
< form name="form1" >
Enter a Number 1:
< input type="text" name="text1" size=3 >
< br >< br >
< input type="button" value="Click to Check" onClick= "checknum()" >
< input type="text" name="text2" size=30 >
< br >
< /form >
< /body >
< /html >
19.
< html >
< title >Example Program to test isNan( ) Function< /title >
< head > < /head >
< body >
< h4 >< u >Example Program to test isNan() Function
< /u >< /h4 >
< script language=" JavaScript" >
function checknum( )
{
var n=document.form 1.text1.value;
if(isNaN(n)=true)
{
document.form1.text2.value="Not a Number:"+n;
}
else
{
document.forml.text2.value="It is Number: "+n;
}
}
< /script >
< form name="forml" >
Enter a Number1:
< input type="text" name=rtext1" size=3 >
< br >< br >
< input type=t'button" value="Click to Check" onClick="checknum( )" >
< input type="text" name="text2" size=30 >
< br >
< /form >
< /body >
< /html >
20.
< html >
< head >
< title > Function Example < /title >
< script type = "text/JavaScript'' >
var input 1 = window.prompt("Enter Valuel :", "0");
var input2=Window.prompuEnter Value2:","0");
var v1=parselnt(input1);
var v2=parselnt(input2);
var s=sum(v1,v2);
document. writeln(" < br > < h4 >< u > Example for
Function< /u >< /h4 >");
document. writeln("First No: "+v 1+< br > Second
No:"+ v2+"< br >The Sum = " + s);
function sum(x, y)
{
var s=x+y;
return s;
}
< /script >
< /head >
< body >
< /body >
< /html >
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