computer solved exercises Chapter11-13
computer solved exercises Chapter11-13
1. JavaScript
2. <SCRIPT>
3. window.write( )
4. window.prompt ( )
5. var
Ex.B write down the JavaScript statements to perform the following tasks.
Document.write() Window.prompt()
This method is used for displaying the This method is used for getting input
text on the browser window. from the user.
Window.alert() Window.confirm()
This method is used for displaying a This method evaluate a value, based on
short message to the user in a small a decision made by a user.
window.
HTML JavaScript
HTML is a markup language used to It is an scripting language used to add
create webpages. functionality to a web page.
parseInt() parseFloat()
This method converts string value into This method converts string value until
an integer value without decimal place first decimal place.
.
Arithmetic operators Comparison operators
Arithmetic operators are used to These operators are used to test if two
perform Arithmetic calculations using variables relate to each other in the
variables or constants. specified way. These return values
either True or False.
Ans.
Ans. An external JavaScript file is simply a text file containing JavaScript code with
a .js file extension.
Ans. Comments can be added to make the code more readable. Comments are
none executable statements. There are two different types of comments.
Single line comment: These comments begin with a double slash sign.
Ans. Variables are the names assigned to a memory location that can be used for
storing data. Its value can change during the execution of a script. We can declare
a variable in JavaScript by using var.
Ex.A
1. Events
2. Rapid Application Development
3. Interpreter
4. Assembler
5. Machine
1. Assembler
An assembler is a program which is used to convert assembly language
program into machine language.
2. Programming language
Programming language is used to write computer program that computer
can understand and interpret.
3. Modular programming
Modular programming refers to a technique in which the logical parts of a
problem is divided into a series of individual routines.
4. Event- driven programming
Programming the code that executes in response to an event is called
event-driven programming.
5. Object Oriented programming
In object oriented programming , a program is no longer a series of
instructions, but a collection of objects.
Ex.D Answer the following questions.
Q.1 what is a program?
Ans : A program is a set of instructions given to a computer to accomplish a
certain task.
Q.2 Name the five generations of computer language.
Ans. Five generations of computer language are:
First Generation (Machine Language)
Second Generation (Assembly language)
Third Generation (High Level Language)
Fourth Generation (Very high level languages)
Fifth Generation (Artificial Intelligence)
Q.4 What are the important features of fourth generation computer language?
Ans.
Compiler :
A compiler is a program that converts program written in high level into machine
language all at once.
Interpreter :
It is a program that translate source code into intermediate code line by line.
Chapter # 14 Introduction to C++
1. Relational operators
2. Comments
3. Variables
4. Object program
5. Syntax error
6. Assignment
#include <iostream.h>
void main( ); #include<iostream.h>
{ void main( )
cin>> x; {
cout<< The value is>>x cin>>x;
} cout<<”The value is” << x;
}
Ex.C Classify as valid or invalid identifiers and give reason for your answer.
Ans. cin>>Num1;
Ans. Identifiers whose value does not change during program execution are called
constants.
1. it can consist of alphabets, digits and only one special character that is an
underscore.
2. It can start with an alphabet or an underscore , but not with a digit.
3. C++ is a case sensitive.
4. The keywords cannot be used as identifiers.
Ans. Debugging is the process of identifying and removing errors from the
program. Press Alt+F9 to debug the program.
Ans. Values in a variable can be either initilised or accepted from the user.
Variable initilisation is to assign a value to a variable that can change during the
execution of the program.
Example
float marks=80.7;
Note: Copy solved examples of C++ programs (only page 171) in notebook .