I. Choose The Correct Answer
Question 1.
Which provided a common scripting language for web developers to design, test and deploy Internet Application
(a) C
(b) C++
(c) Java
(d) Java Script
Answer:
(d) Java Script
Question 2.
Expand CGI
(a) Common Gateway Interface
(b) Complex Gateway Information
(c) Common Gateway Information
(d) Complex Gateway Interface
Answer:
(a) Common Gateway Interface
Question 3.
JavaScript programming language is used to develop the
(a) Dynamic Web Page
(b) Window
(c) Web Page
(d) Home Page
Answer:
(a) Dynamic Web Page
Question 4.
The Dynamic Web Page help to save server’s
(a) Work
(b) Route
(c) Traffic
(d) Pvath
Answer:
(c) Traffic
Question 5.
User entered data, is validated before sending it to server is called ………………………
(a) Server traffic
(b) Dynamic Web Page
(c) Server Route
(d) Web server
Answer:
(b) Dynamic Web Page
Question 6.
Java Scripts can be implemented using which statements?
(a)
(b)
(c)
Question 2.
What is scope of variables and types of scope variable?
Answer:
The spope of a variable is the life time of a variable of source code in which it is defined.
Question 3.
Write a notes on type casting in JavaScript?
Answer:
Type conversion is the act of converting one data type into a different data type which is also called as casting. In JavaScript there are two type of casting:
Question 4.
How many Literals are there in JavaScript and mention its types?
Answer:
There are five Literals in JavaScript. They are Integer, Floating point, Character, String and Boolean.
Question 5.
What is conditional operator give suitable example?
Answer:
The ?: is the conditional operator in JavaScript, which requires three operands, hence it is called the ternary operator. The syntax is:
var variablename = (condition) ?
value 1 : value2;
In the syntax, condition may be relational expression or logical expression. First condition will be evaluated, if the condition returns true then the value of the left side of the color is assigned to the variable otherwise the value of the right side of the colon will be assigned the variable.
Eg: var result = (10 > 15) ? 100 : 150;
Question 6.
What are the comments in Java Script?
Answer:
A very important aspect of good programming style is to insert remarks and comments directly in source code, making.it more readable to yourself as well as to others. Any comments you include will be ignored by the JavaScript interpreter. There are two types of comments, Single line and Multiple line comments. Single-line comments begin with a double slash (//), causing the interpreter to ignore everything from that point to the end of the line. Multiple line comments begins with /* and ends with */.
Eg:
//JavaScript single line comment//
Multiple line comments begins with /* and ends with */.
Question 7.
Write note on types of Operator?
Answer:
The type of operator is used to get the data type (returns a string) of its operand. The operand can be either a literal or a data structure such as a variable, a function, or an object. The – operator returns the data type.
Syntax
typeof operand
or
typeof (operand)
typeof returns:
boolean, function, number, string, and undefined. The following table summarizes possible values returned by the typeof operator.
Question 8.
Write the role of variable in Java Script?
Answer:
JavaScript Variables : Variable is a memory location where value can be stored. Variable is a symbolic name for a value. Variables are declared with the var keyword in JavaScript. Every variable has a name, called identifier.
Question 9.
What is the uses of prompt dialog box?
Answer:
The prompt dialog box is very useful when the user want to pop-up a text box to get user input. Thus, it enables you to interact with the user. The user needs to fill in the text box field and then click OK.
III. Answer To The Following Questions
Question 1.
What are the advantages of programming language?
Answer:
Question 2.
Brief the basic data types in Java Scripts?
Answer:
The basic data types in JavaScript are Strings, Numbers, and Booleans.
Question 3.
Write note on string Operator?
Answer:
The + operator performs addition on numbers but also serves as the concatenation operator for strings. Because string concatenation has precedence over “numeric addition, + will, be interpreted as string concatenation if any of the operands are strings. + operator which is also called as the string concatenation operator.
Question 4.
Write about
The tags. The
Question 4.
Write a JavaScript program using all arithmetic operators?
Answer:
- To test Arithmetic Operators in JavaScript
Question 5.
Write the relational / comparison operators using JavaScript?
Answer:
Relational operators are also called as Comparison operators, they compares two values and the result is true or false. JavaScript provides a rich set of relational operators including == (equal to), != (not equal to), < (less than), > (greater than), <= (less than or equal to), and >= (greater than or equal to). Using a relational operator in an expression causes the expression to evaluate as true if the condition holds or false if otherwise.
Question 6.
Write a JavaScript program using logical operator?
Answer:
Question 7.
Write a JavaScript program using + operator for concatenating string?
Answer:
Question 8.
Write a JavaScript program using “typeof operator”?
Answer: