12. What do you mean by message passing?
Objects communicate with one another by sending and receiving information. A
message for an object is a request for execution of a procedure, and therefore will
invoke
a function in the receiving object that generates the desired result. Message
passing
involves specifying the name of the object, the name of the function and the
information
to be sent.
13. List out the benefits of OOPS.
Through inheritance, we can eliminate redundant code and extend the use
of existing classes.
The principle of data hiding helps the programmer to build secure
programs.
It is possible to have multiple instances of an object to co-exist without
any interference.
Object oriented systems can be easily upgraded from small to large
systems.
Software complexity can be easily managed.
14. List out the applications of OOPS.
Real time systems
Simulation and modeling
Object oriented data bases
AI and expert systems
14. What is an expression?
An expression is a combination of operators, constants and variables arranged as
per rules of the language. It may include function calls which return values.
16. Define keywords?
Keywords are explicitly reserved identifiers and cannot be used as names for the
program variables or other user defined program elements.
17. Why do we need the preprocessor directive #include <iostream.h>?
This directive causes the preprocessor to add the contents of the iostream.h file
to
the program. It contains the declarations for the identifier cout and the operator
<<. It
contains function prototypes for the standard input output functions.
18. What is the use of return statement in main() function?
In C++, main() returns an integer type value to the operating system. Therefore,
every main() in C++ should end with a return(0) statement; otherwise a warning or
an error might occur.
19. How does a main() function in C++ differ from main() in C?
In C++, main() returns an integer type value to the operating system but in C ,
main() returns nothing to operating system by default.
20. What is formal parameter?
If a function is to use arguments , it must declare variables that will accept
the values of the arguments. These variables are called the formal parameters of
the
function.
Example : int max(int a , int b) // Variables a and b are formal parameters {
if(a>b) return a; return b; }
21. What is global variable?
Global variables are known throughout the program and may be used by any
piece of code. Also, they will hold their value throughout the program‟s execution.
22. What is the use of exit( ) function?
The exit( ) function causes immediate termination of the entire program, forcing a
return to the operating system.
The general form :
Void exit(int return code);
The value of return code is returned to the calling process, which is usually the
operating system. Zero is generally used as a return code to indicate normal
program
termination.
23. What is the use of break and continue statements?
Break is used to terminate a case in the switch statement. Force immediate
termination of a loop, bypassing the normal loop conditional test.
Continue is used to force the next iteration of the loop to take place, skipping
any
code in between.