2nd PUC Computer Science Question Bank Chapter 5 Review of C++ Covered in First PUC

You can Download Chapter 5 Review of C++ Covered in First PUC Questions and Answers, Notes, 2nd PUC Computer Science Question Bank with Answers Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Karnataka 2nd PUC Computer Science Question Bank Chapter 5 Review of C++ Covered in First PUC

2nd PUC Computer Science Review of C++ Covered in First PUC One Mark Questions and Answers

Question 1.
What does OOP mean?
OOP means Object-Oriented Programming.

Question 2.
What is object-oriented programming?
Object-oriented programming (OOP) is a programming language model organized around “objects” rather than “actions” and data rather than logic of the program.

Question 3.
Define object.
An object is a combination of code and data that can be treated as a unit. An object can be considered any real-time entity (existing thing) that can perform a set of related activities.

KSEEB Solutions

Question 4.
Define class.
A class is simply a representation of a type of object. It is the blueprint/ plan/ template that describe the details of an object.

Question 5.
Which programming approach the OOP follows?
The OOP follows Bottom-up approach of programming.

Question 6.
What is the meaning of abstraction in OOP?
Abstraction in OOP is “A model of a complex system that includes only the details essential to the perspective of the viewer of the system.”

Question 7.
Define encapsulation.
It is the method of combining the data, attributes, and methods in the same entity is called encapsulation.

Question 8.
What is polymorphism?
Polymorphism is a Greek word that means Many Shapes. In OOP Polymorphism means the ability to take on many forms. The term is applied both to objects and to operations.

KSEEB Solutions

Question 9.
What is dynamic binding?
Dynamic binding means link exist between procedure call and code to be execute at run time when that procedure is call.

Question 10.
What is message passing?
Message passing is a method by which an object sends data to another object or requests other object to invoke a method. This is also known as interfacing.

Question 11.
Describe tokens
The smallest individual units in a program are known as tokens.

Question 12.
Mention few tokens.
The few tokens are Keywords, identifiers, constants, strings, and operators.

Question 13.
What is a keyword?
All keywords (reserved words) are basically the sequences of characters that have one or more fixed meanings.

Question 14.
What are identifiers?
Identifiers are names given to the program elements such as variables, arrays, and functions.

Question 15.
What are constants?
The quantity, which does not change during the execution of a program, is known as a constant.

Question 16.
Define character set.
It is a set of symbols that a programming language identifies and used in writing data and instructions in a programming language.

KSEEB Solutions

Question 17.
What is integer constant?
Integer constants are the whole number without any fractional part.

Question 18.
What are floating-point constants?
Floating-point constants are numeric values that contain decimal point and can contain exponents.

Question 19.
Define octal constant.
It consists of a sequence of digits starting with 0 (zero).

Question 20.
Define hexadecimal constants.
It consists of a sequence of digits from 0 to 9 and A, B,C, D, E, F alphabet symbols that represent decimal numbers 10,11,12,13,14, and 15 respectively preceded by ox or OX.

Question 21.
What are character constants?
A character constant in C++ must contain one or more characters and must be enclosed in single quotation marks.

Question 22.
What is an operator?
An operator is a symbol that performs specific operation and gives a value as the result.

Question 23.
What are arithmetic operators?
The symbols that perform addition, subtraction, multiplication, modulus, and division are called arithmetic operators.

Question 24.
Give the difference between / and % arithmetic operators.
The arithmetic operator / perform division and gives out the quotient as a result. The arithmetic operator % performs division and gives out the reminder as a result.

KSEEB Solutions

Question 25.
What is an operand?
The operand is a data item on which the operator perform some activity.

Question 26.
What are unary operators?
An operator that takes only one operand to perform some operation is called a unary operator.

Question 27.
What are binary operators?
The operators which takes two operands to perform some operation is called a binary operator.

Question 28.
What are relational operators?
The operators which perform operation of relation between two operands called relational operators.

Question 29.
What are logical operators?
The operators which perform combine or negate the expressions that contains relational operators are called logical operators.

Question 30.
What is the function of bitwise operator?
Bit manipulation operators manipulate individual bits within a variable. Bitwise operators modify variables considering the bit patterns that represent the values they store.

Question 31.
What is meant by shorthands in C++?
In C++ shorthands means writing the certain type of assignment statements in simplified manner.

Question 32.
What is a ternary operator?
The operator that operates on three operands is called the ternary operator.

Question 33.
What is an expression?
An expression is a combination of constants, variables, operators, functions calls which produces a particular value to be used in any other context.

Question 34.
What is a statement?
Statement is an instruction to the computer telling it what to do for instance assigning an expression value to a variable because it produces an instructions tells the computer to assign a value to something.

Question 35.
What is the use of iostream.h in C++?
Iostream stands for input/output stream. It is a header file which we include in our programs to perform basic input-output operations.

KSEEB Solutions

Question 36.
Mention any two ctype.h functions.
Toupper() and tolower() are the two example for ctype.h functions.

Question 37.
Mention any two string.h functions.
Strupr() and strlwr().

Question 38.
Mention any two functions of stdio.h
Printf() and scanf() are the two functions of stdio.h.

Question 39.
Mention any two functions of stdlib.h
Atoi() and itoa() are the two functions for stdlib.h

Question 40.
What is a preprocessor directive?
Preprocessor directive is a command that is considered for execution before the processor executes the program.

Question 41.
What is meant by data types?
The set of values along with the operations that can be performed on these values are called as data types.

Question 42.
Give the classification of data types.
Data types are classified into built-in or basic data types and user-defined or derived data types.

Question 43.
Name the built-in data types of C++.
The built-in or basic data types supported by C++ are integer, floating-point, and character.

Question 44.
How is derived data type created?
The derived data type is created by using basic data types.

Question 45.
What is a linear data structure?
The data elements are arranged in a sequential manner is called a linear data structure.

Question 46.
What is the non-linear data structure?
The data elements that are arranged non-sequentially is called non-linear data structure.

Question 47.
Define modifiers.
The modifiers change the meanings of the predefined built-in data types and expand them to a much larger set.

Question 48.
Write the different modifiers.
The different modifiers are long, short, signed and unsigned.

Question 49.
What is a stream?
A stream is an object where a program can either insert or extract characters to/from it.

KSEEB Solutions

Question 50.
Give the classification of stream.

  • input streams
  • output streams

Question 51.
What is input stream?
Input stream is a sequence of characters from input device like keyboard to the program of a computer.

Question 52.
What is output stream?
Output stream is a sequence of characters from the program to output device like monitor, printer.

Question 53.
What is meant by stream extraction?
cin is used in conjunction with >> operator, known as extraction or get from operator.

Question 54.
What is meant by stream insertion?
cout is used in conjunction with << operator, known as insertion or put to operator.

Question 55.
Give the syntax of cin statement.
Syntax: cin >> variable.

Question 56.
Give the syntax of cout statement.
Syntax : cout << expression or manipulator

Question 57.
What is cascading in I/O operations?
The cascading is a way to extract/insert multiple values from/into more than one variable using one cin/cout statement.

Question 58.
What are manipulators?
A manipulator is a C++ is used to control the formatting of output and/or input values.

Question 59.
Give an example for manipulator.
endl is a manipulator.

Question 60.
What is a statement?
Statements are the instructions given to the computer to perform any kind of action. Action may be in the form of data movement, decision making, etc.

Question 61.
What are control statements?
Control Statements are elements in the program that control the flow of program execution.

Question 62.
Write the classification of control statements.
The control statements are classified as

  1. Selection statement
  2. Iterative statement
  3. Jump statement

Question 63.
What is meant by the compound statement?
A compound statement is a grouping of statements enclosed between the pair of braces ({ }) in which each individual statement ends with a semi-colon.

KSEEB Solutions

Question 64.
What are selection statements?
The selection statements are used to execute certain block of statements the evaluating the condition.

Question 65.
What is a block?
The group of statements separated by a semicolon and is marked with {} is called block.

Question 66.
What is the purpose of if statement?
The if statement is used to decide on whether a statement or a block should be executed or not.

Question 67.
Define the term looping.
The looping means execution of a statement or block of statements again and again until the condition is true.

Question 68.
Why is while loop is called a pre-tested looping statement?
The while loop evaluates the condition in the beginning itself to select statement for execution repeatedly. Therefore it is called pre-tested looping statement.

Question 69.
What is post-tested looping statement?
The loop evaluates the condition in the end of the looping structure and select a statement for execution repeatedly. Therefore it is called post-tested looping statement.

Question 70.
Name the post-tested looping statement.
The do-while statement is called a post-tested looping statement.

Question 71.
Which structure is called a fixed-execution looping statement?
The ‘for’ looping statement is called a fixed-execution looping statement.

Question 72.
When is ‘for’ used?
If a programmer knows the exact number of repetition to be carried among the set of statements then ‘for’ conditional statement is used in a program.

Question 73.
What is the nesting of the loop?
If the loop appears inside the body of another loop is called a nested loop.

Question 74.
What is an Array?
Array is a group of similar elements that share a common name.

Question 75.
What is the use of arrays?
Use of arrays reduces the creation and use of more number of individual variables in a program. It also helps to reduce the program length.

Question 76.
Mention the different types of arrays.
There are three types of arrays

  1. One dimensional array
  2. Two-dimensional array
  3. Multidimensional array

KSEEB Solutions

Question 77.
What is Index or subscript of an Array?
Subscript is used to identify/locate the position of array elements.

Question 78.
What is zero-based indexing?
If ‘i’ is the element, then its index number would be i-1 is called zero-based indexing.

Question 79.
What is the subscript of the first element of an array?
The first element i = 1, then subscript is 0 because of i-1 i.e., 1-1.

Question 80.
Mention any one feature of subscript or index of an array.
Subscript or index of an array is always a positive whole number.

Question 81.
Define a one-dimensional array.
One dimensional array is a collection of similar elements that share a common name and is structured in one dimension.

Question 82.
Give the declaration syntax of a one-dimensional array.
datatype arryname [size];

Question 83.
What is meant by initialization of an array?
Initialization means assigning values to declared variables or arrays. To initialize an array, each and every element of the array has to be referred and then value is assigned to it.

Question 84.
Give an example showing initialization of one-dimensional array.
int marks[6] = {91,96,90, 94,99,93};

Question 85.
Define a two-dimensional array.
Two-dimensional array is a collection of elements of similar type that share a common name, structured in two dimensions. Each element is accessed by two index values.

Question 86.
Write the declaration syntax of two-dimensional array.
<data-type> <array-name> [<size1>] [<size2>];

Question 87.
Give an example of, How a two-dimensional array is declared?
int marks[5][5];

Question 88.
Give one example showing initialization of two-dimensional array.
Example of array initialization with declaration:
int matrix [3] [3] = {91, 96, 90, 94,99,95,87,92,98};

Question 89.
Declare an array to store the 6 subject marks of 500 students.
Int marks [500] [6];

Question 90.
How an element in the two-dimensional array is accessed?
An element in the two-dimensional array is accesses using two index/subscript numbers. The first number indicates the row index and the second number indicates the column index.

Question 91.
Define multidimensional array.
A collection of similar elements structured in N dimensions where N>=1. Each element is accessed by N indices.

Question 92.
Define function.
A FUNCTION is a self-contained block of statements that perform a specific task with a name given to it.

Question 93.
How are functions classified?
The functions classified as

  1. Library function/pre-defined functions
  2. User-defined functions

Question 94.
What is a Predefined Functions in C++?
Predefined functions are functions that are built into C++ Language to perform some standard operations that are stand-alone and used for general purposes.

KSEEB Solutions

Question 95.
What is the header file?
A header file is a file containing all the library function definitions that can be used in a program.

Question 96.
List any two basic types of standard library functions.

  1. I/O Functions.
  2. Mathematical Functions – math.h

Question 97.
Write the names of any two C++ header files.
The two header files are

  • iostream.h
  • iomanip.h

Question 98.
List the names of any two functions of iostream.h header file.
The two functions of iostream.h files are

  • cin
  • cout

Question 99.
List the names of any two functions of iomanip.h header file.
The two functions of iomanip.h files are

  1. endl
  2. setw

Question 100.
What is the main function of iostream.h header file?
The iostream.h header file contains C++ streams and i/o routines functions. It is a header file which we include in our programs to perform basic input output operations. We use cin in program to get input from the keyboard. To use cin and cout, we must add iosream.h header file.

Question 101.
What is the main function of iomanip.h header file?
The iomanip.h header file contains various function and macros for i/o manipulations for creating parameterized manipulations.

Question 102.
Define string.
The term string is defined as a character array terminated with a null character [‘\0’].

Question 103.
What is null in string?
The null in a string is control character ‘\0’ that indicate the end of the string.

Question 104.
How is string declared?
The declaration of string is
char arrayname[ size];

Question 105.
Give one example of string initialization.
char name[50]=”bharath”;

Question 106.
Name the function used for string input.
The function getline() is used to read a string.

KSEEB Solutions

Question 107.
How is input is terminated in getline()?
The input gets terminated when a newline character is entered or when entered character length is equal to the size of character array.

Question 108.
Name function used for string output.
The function write() is used for string output.

Question 109.
What is a null string?
The length of the string 0 is called a null string.

Question 110.
What is a user-defined function?
A user-defined FUNCTION is a self-contained block of statements that perform a specific task with a name given to it defined by the user in a program.

Question 111.
Mention any one advantage of user-defined function.
Code Reusability:
writing the same sequence of code at two or more locations in the program can be avoided with the use of functions and Universal use feature reduces rewriting of codes again and again.

Question 112.
What is meant function definition?
A function definition provides the actual body of the function with a name that you call it by, a list of zero or more arguments and it may give back a return value, of a particular type.

Question 113.
What is function declaration?
A function declaration tells the compiler about a function’s name, return type, and parameters.

Question 114.
What is meant by calling a function?
To use a function, the user will have to call or invoke that function. It helps to execute the function and perform the process of a function.

Question 115.
What is called function?
A called function is a function which is called from the calling function.

Question 116.
How is a function invoked?
Function can be invoked by a giving a call to the function.

Question 117.
Give the purpose of return statement.
It is used to return the value from the called function to the calling function.

Question 118.
What is a function prototype?
The declaration of a function before it is used or called is known as function proto type.

Question 119.
Give the default return type of main() function.
The default return type of main() function is int data type.

Question 120.
What is function parameter?
Sometimes the calling function supplies some values to the called function. These are known as parameters.

Question 121.
What is the significance of void in function return type?
A function that does not return a value is declared and defined as void.

KSEEB Solutions

Question 122.
Why are arguments used in functions?
The arguments are the mechanism that carries values from calling function to called function.

Question 123.
What are the actual arguments?
The data that is passed by the calling function as arguments/parameters is known as actual arguments, i.e., the arguments which are present at the time of function call.

Question 124.
What are formal arguments?
Formal parameters or dummy parameters are the names of the argument/parameter in the function header of the called function.

Question 125.
What is global variable?
A variable that is declared outside any function is known as a global variable.

Question 126.
What is the scope of global variable? .
The scope of global variable is extended till the end of the program.

Question 127.
What are local variables?
The variables declared within function block are called local variables.

Question 128.
What is the use of return statement in a function?
The return statement sends both control and value back to the calling function.

Question 129.
Mention the limitation of return statement.
The return statement return value is limited to a single value.

KSEEB Solutions

Question 130.
Write the syntax of function prototype.
Returntypespecifier function name( datatype argument1, datatype argument2, ..);

Question 131.
Define structure.
A structure is a collection of variable which can be same or different types.

Question 132.
What is the use of structures?
Struct ures can be used to handle a group of logically related data items like register number, student name, subject marks, etc., under a single name.

Question 133.
What is the purpose of a struct keyword?
It is the reserved or keyword used in structure definition.

Question 134.
What is structure tag?
Structure tag is a name given by the programmer and used to identify the structure in future re-definitions.

Question 135.
What is the structure template?
The list of all structure members is called a template.

Question 136.
What purpose does structure definition serve?
The structure definition acts as a blueprint for the creation of variables.

KSEEB Solutions

Question 137.
How is a member of a structure accessed?
The member of structure is accessed using dot (.) operator.

Question 138.
Write the declaration syntax for a structure variable.
The general syntax for declaration of structure variable is Structurename variable;