SaraNextGen.Com

Text Book Back Questions and Answers - Chapter 16 Javascript Functions 11th Computer Application Guide Samacheer Kalvi Solutions - SaraNextGen [2024-2025]


Updated By SaraNextGen
On April 24, 2024, 11:35 AM

Samacheer Kalvi 11th Computer Applications Solutions Chapter 16 Javascript Functions - Text Book Back Questions and Answers

I. Choose The Correct Answer

Question 1.
The parameters work as:
(a) local variable
(b) global Variable
(c) file variable
(d) block variable
Answer:
(a) local variable

Question 2.
Predefined functions are also called as:
(a) library functions
(b) storage functions
(c) instructions
(d) commands
Answer:
(a) library functions

Question 3.
Larger programs are divided into smaller are called:
(a) modules
(b) block
(c) sets
(d) group
Answer:
(a) modules

Question 4.
Which of the following is used to enhance re-usability and program clarity?
(a) Functions
(b) Modules
(c) Sets
(d) Instructions
Answer:
(a) Functions

Question 5.
Which of the following allow the programmer to modularize a program?
(a) Library functions
(b) User defined functions
(c) Normal functions
(d) Ordinary functions
Answer:
(b) User defined functions

II. Answer To The Following Questions

Question 1.
What is a function in JavaScript?
Answer:
A function is a block of JavaScript code that is defined once but may be executed or invoked any number of times. Functions are used to encapsulate code that performs a specific task.

Question 2.
What is the use of function?
Answer:
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 code that performs a particular job in one place in order to enhance re-usability and program clarity.

Question 3.
Write a note on Library functions?
Answer:
Pre-defined functions are already defined in the JavaScript library which are also called Library functions. For example isNaN( ), toUpperCase( ), toLowerCase( ), length( ), alert( ), prompt( ),write( ) etc… are pre-defined functions.

Question 4.
Write a note on user defined functions?
Answer:
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 are called modules.

Question 5.
Write the syntax of functions?
Answer:
The format of a function definition is –
Function function-name(parameters list)
{
Declaration of variable Executable statements;
}

III. Answer To The Following Questions

Question 1.
Write a program in JavaScript to find the cube of a number using function?
Answer:




print the cube number
 



Function cube

 

 




OUTPUT
Enter value : 5
Cube Function Number : 5
The cube : 125

Question 2.
Write a program in JavaScript to find the sum of 10 numbers using function?
Answer:

 

 

 

 


Function sum of 10 Numbers





OUTPUT
Enter initial value : 1
Enterfinal value : 10
Function for sum of 10 numbers
Initial No : 1
FinalNo : 10
The result : 55

Additional Questions and Answers

I. Choose The Correct Answer

Question 1.
…………………… often use their argument values to compute a return value that becomes the value of the function invocation expression.
(a) function
(b) parameter
(c) non-parameter
(d) expression
Answer:
(a) function

Question 2.
…………………… method returns the element that has the ID attribute with the specified value.
(a) elements [o]
(b) getElementByid( )
(c) Nan ( )
(d) NaN (“A”)
Answer:
(b) getElementByid( )

II. Short Answers

Question 1.
What are the types of function?
Answer:
JavaScript supports two types functions. They are:

  1. Pre-defined or Library Functions
  2. User-defined Functions

Question 2.
Define NaN( )?
Answer:
The is NaN( ) function is used to check whether the given value or variable is valid number. This function returns true if the given value is not a number. For example is NaN(“12”), is NaN(“A”).

Question 3.
What are the different types of predefined functions?
Answer:

III. Explain in Detail

Question 1.
Write a program to find the sum of 2 numbers?
Answer:

 

 


Function Example

 

 

 

 

 

Question 2.
Write a program to validate whether the entered value is a number or not?
Answer:




Example Program to test isNan( ) Function

 

 

 

Example Program to test isNan() Function

 


Enter a Number 1:







 

 

 

Question 3.
Write a program using functions to have an online quiz?
Answer:

 

 


On-line Quiz

 

 

 

 

 

Which is not a Programming Language:


MS-Word

COBOL

C++

Visual BASIC



 

 

 

 

Also Read : Text-Book-Back-Questions-and-Answers-Chapter-17-Computer-Ethics-and-Cyber-Security-11th-Computer-Application-Guide-Samacheer-Kalvi-Solutions

SaraNextGen