CBSE Class 11 C++ | Sample Paper -2
Model Question Paper
M.M: 70 Time: 3 hrs.
1. All Question are compulsory.
2. Programming language :C++
Q.1[A] How is a compiler different from interpreter ? 2
Compiler and Interpreter are two different ways to execute a program written in a programming or scripting language.
- Compiler takes entire program and converts it into object code which is typically stored in a file. The object code is also refereed as binary code and can be directly executed by the machine after linking. Examples of compiled programming languages are C and C++.
- Interpreter directly executes instructions written in a programming or scripting language without previously converting them to an object code or machine code. Examples of interpreted languages are Perl, Python and Matlab.
Refer: Compiler vs Interpreter
[B] What do you understand by application software ? 2
These are the basic software used to run to accomplish a particular action and task. These are the dedicated software, dedicated to perform simple and single tasks. These are divided into two types:
a) The General Purpose Application Software:
Microsoft Excel – Used to prepare excel sheets.
VLC Media Player – Used to play audio/video files.
Adobe Photoshop – Used for designing and animation and many more.
b) The Specific Purpose Application Software:
Ticket Reservation System
Healthcare Management System
Refer: Software Concepts
[C] Who invented the punched card ? 1
Herman Hollerith invented the punch card.
[D] Name the super computers developed in India ? 1
The super computers developed in India are: PARAM, ANURAG
Q.2[A] What is meant by Graceful Degradation ? 2
Graceful degradation is the ability of a computer, machine, electronic system or network to maintain limited functionality even when a large portion of it has been destroyed or rendered inoperative.
[B] Why are logical Errors harder to locate ? 2
The type of errors which provide incorrect output but appears to be error free are called logical errors. These are one of the most common errors done by beginners of programming.
Logical Errors are difficult to find because isolating these errors solely depends on the logical thinking of the programmer and can only be detected, if we follow the line of execution and determine why the program takes a specific path of execution.
Refer: Logical Errors
[C] Write steps required to develop a program and explain the steps briefly. 3
Program development requires 6 phases, they are as follows:
Coding & Documentation.
Testing & Debugging.
Q3[A] Name the header files to which the following belongs to:- 2
(ii) gets(): stdio.h
(iii) tolower(): ctype.h
(iv) malloc(): stdlib.h
[B] What will be the output of the following statements: 2
(i) a = sqrt(16): 16
(ii) b= strlen(“COMPUTER”): 8
(iii)c = ceil(13.45): 14
(iv) d =abs(-6): 6
[C] What is the purpose of sizeof operator ? 2
Sizeof is a compile time unary operator which can be used to compute the size of its operand. The result of sizeof is an unsigned integral type. Sizeof can be applied to any data-type, including primitive types such as integer and floating-point types, pointer types, or compound datatypes such as Structure, union etc.
Refer: sizeof operator
[D] Write differences between Unary Operator and Binary Operator 2
Unary operator: The operators that act upon a single operand to produce a new value.
Types of unary operators: unary minus(-), increment(++), decrement(–), NOT(!), Address of operator(&) and sizeof() operator
Binary Operator: Operators that operates or works with two operands are binary operators. example: Types of Binary operators: Addition (+), Subtraction (–), Multiplication (*), Division(/) etc.
Refer: Unary operators in C/C++, Operators in C++
Q.4[A] Write differences between entry controlled loop and exit controlled loop 2
- Entry Controlled loops: In this type of loops the test condition is tested before entering the loop body. Example: For Loop and While Loop are entry controlled loops.
- Exit Controlled Loops: In this type of loops the test condition is tested or evaluated at the end of loop body. Therefore, the loop body will execute atleast once, irrespective of whether the test condition is true or false. Example: Do while loop is exit controlled loop.
Refer: Loops in C++
[B] Write a program to input a character and to print whether a given character is an alphabet, digit or any other character.
Logic: All characters whether alphabet, digit or special character have ASCII value. Input character from the user will determine if it’s Alphabet, Number or Special character.
ASCII value ranges-
For capital alphabets 65 – 90
For small alphabets 97 – 122
For digits 48 – 57
All other cases are Special Characters.
[C] Give the output for the following program segment: 2
Q.5[A] what is the difference between following two statements :- 1
(i) int sum;
(ii) int sum= 20;
The difference between these two statements are :
in first statement, an integer array of 10 elements has been declared and values are not assigned to the elements of the array.
In the second statement, an integer array of 10 elements has been declared and all the elements of the array have been assigned the value = 20
[B] Rewrite the following program after removing the syntactical errors.underline each
[C] Find the output of the following program: 2
Output: 0, 5, 10, 15
[D] Write a program to read a string and print how many words are stored in the string. 3
[E] Write a program to find the sum of array elements. 3
Q.6[A] What do you mean by function prototype ? 1
Function prototype tells compiler about number of parameters function takes, data-types of parameters and return type of function. By using this information, compiler cross checks function parameters and their data-type with function definition and function call.
Refer: Function prototype
[B] What is meant by scope ? Name all kinds of scope is supported by C++. 3
In programming scope of a variable is defined as the extent of the program code within which the variable can we accessed or declared or worked with. There are mainly two types of variable scopes as discussed below:
Variables defined within a function or block are said to be local to those functions.
As the name suggests, Global Variables can be accessed from any part of the program. They are available through out the life time of a program. They are declared at the top of the program outside all of the functions or blocks.
Refer: Scope of variables in C++
[C] Find the output of the following: 3
With a=10, b=13, c=8 when first time max(a, b, c) is called, the output is:
13 13 8
Second time when the function is called, b is assigned a value 8, and the output is:
14 9 9
[D] Write a complete C++ Program that reads a float array having 15 elements. The program uses a function reverse() to reverse this array. 4
[E] Write a C++ function having two parameters x of type float and n of type integer with result type float to find the sum of following series :-
1 + x/2! + x2/4! + x3/6! +……………………+ xn/2n!
Q.7[A] Difference between online UPS and offline UPS. 2
Online UPS systems draw their power through power conditioning and charging components during normal operations.
Offline UPS are systems where the load is fed directly from the raw mains during normal operations, rather than the inverter outputs, to the extent that power storage components such as chargers, inverters and batteries are offline as the load is concerned.
[B] Explain what are the two categories of printers ? 2
Printers are Output devices used to prepare permanent Output devices on paper. Printers can be divided into two main categories :
Impact Printers: In this hammers or pins strike against a ribbon and paper to print the text. This mechanism is known as electro-mechanical mechanism. They are of two types.
Character Printer : It prints only one character at a time. It has relatively slower speed. Eg. Of them are Dot matrix printers.
Dot Matrix Printer : It prints characters as combination of dots. Dot matrix printers are the most popular among serial printers.
Non-Impact Printers: There printers use non-Impact technology such as ink-jet or laser technology. There printers provide better quality of O/P at higher speed.
Example: Ink-Jet Printer
[C] What is access time. 1
Access time is the time from the start of one storage device access to the time when the next access can be started. Access time consists of latency (the overhead of getting to the right place on the device and preparing to access it) and transfer time.
The term is applied to both random access memory (RAM) access and to hard disk and CD-ROM access
[E] Convert the following into its binary equivalent number system :- 3
(i) (EB4A)16 = (60234)10
(ii) (84)10 = (1010100)2
(iii)(B2F)16 = (5457)8
For details, refer: Base conversions
[F] Find the eight bit one’s complement form of the following: 2
(i) -14 (ii) -49
Solution: 1’s complement of a negative number is computed by flipping the bits of its binary representation.
-14 = -(00001110)2 = (11110001)1’s
-49 = -(00110001)2 = (11001110)1’s