11th Computer Science 3rd Revision Test 2023 2024 Questions With Answer Key English Medium PDF Download
11th Computer Science 3rd Revision Test 2023 2024 Questions With Answer Key English Medium PDF Download
com
et
i.N
la
sa
da
Pa
w.
ww
et
i.N
la
sa
da
Pa
w.
ww
et
i.N
la
sa
da
Pa
w.
ww
et
i.N
la
sa
da
Pa
w.
ww
et
8. c) Switch
9. b) sqrt( )
10. d) it will be only declared
i.N
PART – II
II. ANSWER Any 6 QUESTIONS. Q. No: 24 IS COMPULSORY: 6 X 2 = 12
la
Ans: The ALU is a part of the CPU where various computing functions are performed on data. The
ALU performs arithmetic operations such as addition, subtraction, multiplication, division and
sa
logical operations. The result of an operation is stored in internal memory of CPU. The logical
operations of ALU promote the decision-making ability of a computer.
da
17. What are the parameters which influence the characteristics of a microprocessor?
Ans: A Microprocessor’s performance depends on the following characteristics:
a) Clock speed b) Instruction set c) Word size
Pa
19. Both conditional statement and interactive statements have a conditions and a statement. How
ww
do they differ?
Ans:
Conditional Statement Iterative Statement
Condition is evaluated only once. Condition is evaluated repeatedly until it
becomes false.
Syntax: Syntax:
if C while C
S S
Where Where
C is a condition and C is a condition and
S is a statement S is a statement
Execution Style: Execution Style:
i. Test whether C is true or false. i. Test whether C is true or false.
ii. send
kindly If C isme
true thenkey
your do Answers
S, otherwise ii. [email protected]
to our email true then do S and go back to
do nothing. step I, otherwise do nothing.
Example:
www.Padasalai.Net Example:www.Trb Tnpsc.com
if a < b While a >= 2
result:=a a:=a-2
et
i.N
20. What are the modifiers? What is the use of modifiers?
Ans: Modifiers can be used to modify ( expand or reduce ) the memory allocation of any fundamental
data type. They are also called as Qualifiers.
la
There are four modifiers used in C++. They are:
1) signed sa 2) unsigned 3) long 4) short
21. Write the syntax of the alternative to if-else statement with an example.
Ans: The ?: Alternative to if- else
da
The conditional operator (or Ternary operator) is an alternative for ‘if else statement’. The
conditional operator that consists of two symbols (?:). It takes three arguments. The control flow
of conditional operator is shown below:
The syntax of the conditional operator is:
Pa
w.
ww
In the above syntax, the expression 1 is a condition which is evaluated, if the condition is true (Non-
zero), then the control is transferred to expression 2, otherwise, the control passes to expression 3.
et
i.N
la
sa
22. What is the syntax to declare two dimensional arrays?
Ans: The declaration of a 2-D array:
da
Syntax Example
data-type array_name[row_size] [ col_size]; int A[3] [4];
data-type – Any valid C++ data type A – Name of the 2D array
array_name – Name of the 2D array 3 – No .of rows
Pa
Ans: The ability of the function to process the message or data in more than one form is called as
function overloading. In other words function overloading means two or more functions in the
same scope share the same name but their parameters are different.
ww
et
PART – III
i.N
III. ANSWER Any 6 QUESTIONS. Q.No: 33 IS COMPULSORY: 6 X 3 = 18
25. Name any three output devices with an short note.
Ans: The Three frequently used Output devices are
i) Monitor: Displays the output
la
ii) Printer: Prints the output on paper
iii) Plotter: Prints graphical output like printing building plans, flexes etc.
sa
26. Perform the following Binary Operations. i) 13 + 15 ii) 10 + 5 iii) 15 + 20
Ans: i) 13 + 15
2 13 2 15
da
2 6 –1 2 7 –1
2 3 –0 2 3 –1
1 –1 1 –1
Pa
13 = 1101 15 = 1111
1 1 1
13 = 1 1 0 1
w.
14 = 1 1 1 1 (+)
11 0 0 0
ww
13 + 15 = 11000
10 = 1010 5 = 101
10 = 1 0 1 0
5= 1 0 1 (+)
1 1 1 1
et
10 + 5 = 1111
i.N
iii) 15 + 20
2 15 2 20
2 7 –1 2 10 – 0
la
2 3 –1 2 5 –0
1 –1 sa 2 2 –1
1 –0
15 = 111
20 = 10100
da
1 1
20 = 1 0 1 0 0
15 = 1 1 1 1 ( + )
Pa
10 0 0 1 1
15 + 20 = 100011
w.
27. Write down the classifications microprocessor based on the instruction set.
Ans: The two types of microprocessors based on their instruction sets.
i. Reduced Instruction Set Computers (RICS)
ww
et
3. The Protected Members
1. The Public Members: A public member is accessible from anywhere outside the class
i.N
but within a program. You can set and get the value of public data members even without
using any member function.
2. The Private Members: A private member cannot be accessed from outside the class.
Only the class member functions can access private members. By default all the members
la
of a class would be private.
3. The Protected Members: A protected member is very similar to a private member but it
sa
provides one additional benefit that they can be accessed in child classes which are called
derived classes (inherited classes).
da
30. Describe the differences between keywords and identifiers.
Ans:
Keywords Identifiers
Keywords are the reserved words. Identifiers are the user-defined names.
Pa
Keywords are the essential elements to Identifers are the fundamental bulidings blocks
construct programs. of a program.
Most of the keywords are common to C, Every language has specific rules for naming
w.
31. Whatkindly
are arithmetic operators
send me your in C++?toDifferentiate
key Answers our email idunary and binary arithmetic operators.
- [email protected]
Give example for each of them.
Ans: Arithmetic operators perform simple arithmetic operations like addition, subtraction,
www.Padasalai.Net www.Trb Tnpsc.com
multiplication, division etc
Operator Operation Example
+ Addition 10 + 5 = 15
- Subtraction 10 – 5 = 5
* Multiplication 10 * 5 = 50
/ Division 10 / 5 = 2 (Quotient of the division)
% Modulus (To find the 10 % 3 = 1 (Remainder of the
remainder of a division) division)
et
higher. lower compared to Unary operators
Examples: Examples:
i.N
++ -- + - * / %
la
a = m + 5;
else
a = m;
Ans:
sa
a = ( x > = 10 ) ? m + 5 : m;
da
denotes the number of strings and the size of the second index (columns) denotes the maximum
length of each string. Usually, array of strings are declared in such a way to accommodate the
null character at the end of each string.
For example, the 2-D array has the declaration:
w.
char Name[6][10];
In the above declaration, the 2-D array has two indices which refer to the row size and column
size, that is 6 refers to the number of rows and 10 refers to the number of columns.
ww
et
instructions are read from the ROM to initiate the booting process.
2) Warm Booting: When the system restarts or when Reset button is pressed, we call it Warm
Booting or Soft Booting. The system does not start from initial state and so
i.N
all diagnostic tests need not be carried out in this case. There are chances of
data loss and system damage as the data might not have been stored properly.
[ OR ]
b) Find the 1’s complement and 2’s complement for the following decimal number.
la
i) – 65 ii) – 46
Ans:
i) – 65
2 65
sa
2 32 – 1
2 16 – 0
da
2 8 –0
2 4 –0
2 2 –0
Pa
1 –0
( – 65 )10 = ( 1000001 )2
w.
( – 65 ) = 1 0 0 0 0 0 1
1’s Complement ( – 65 ) = 0 1 1 1 1 1 0
ww
0111111
( – 65 )10 = ( 0 1 1 1 1 1 1 )2
ii) – 46
kindly send me your key Answers to our email id - [email protected]
2 46
www.Padasalai.Net www.Trb Tnpsc.com
2 23 – 0
2 11 – 1
2 5 –1
2 2 –1
2 1 –0
(– 46 ) = 1 0 1 1 1 0
1
1’s Complement ( – 46 ) = 0 1 0 0 0 1
2’s Complement = 1(+)
010 0 1 0
et
( – 46 )10 = ( 0 1 0 0 1 0 )2
i.N
35. a) List out the points to be noted while creating a user interface for an operating system.
Ans: Points to be considered while designing an User Interface.
i) The user interface should enable the user to retain this expertise for a longer time.
la
ii) The user interface should also satisfy the customer based on their needs.
iii) The user interface should save user’s precious time.
sa
iv) The ultimate aim of any product is to satisfy the customer. The User Interface is also to
satisfy the customer.
v) The user interface should reduce number of errors committed by the user.
[ OR ]
da
b) Write the specification of an algorithm hypotenuse whose inputs are the lengths of the two
shorter sides of a right – angled triangle, and the output is the length of the third side.
Ans:
Point to consider
Pa
i. Click the start button, the search box appears at the bottom of the start menu.
ii. Type the name of the file or the folder or part of it to search.
iii. The files or the folders with the specified names will appear, if you click that file, it will
directly open that file or the folder.
iv. There is another option called “See more results” which appears above the search box.
v. If you click it, it will lead you to a Search Results dialog box where you can click and open
that file or the folder.
Searching Files or Folders using Computer icon:
i. Click Computer Icon from desktop or from Start menu.
ii. The Computer disk drive screen will appear and at the top right corner of that screen, there is
a search box option.
iii. Type the name of the file or the folder or part of it to search.
iv. Just click and open that file or the folder.
[ OR ]
kindly
b) List send
out the me your
various key Answers
predefined to our
function email iddetail
to explain - [email protected]
about it.
Ans: - C++ provides a rich collection of functions ready to be used for various tasks. The tasks to
www.Padasalai.Net www.Trb Tnpsc.com
be performed by each of these are already written, debugged and compiled, their definitions
alone are grouped and stored in files called header files. Such ready-to-use sub programs
are called pre-defined functions or built-in functions.
- C++ also provides the facility to create new functions for specific task as per user
requirement. The name of the task and data required (arguments) are decided by the user
and hence they are known as User-defined functions.
- C++ Header Files andBuilt-in Functions
Header files provide function prototype and definitions for library functions. Data types and
constants used with the library functions are also defined in them. A header file can be
identified by their file extension .h. A single header file may contain multiple built-in
functions. For example: stdio.h is a header file that contains pre-defined “standard
input/output” functions.
- Standard input/output (stdio.h)
et
This header file defines the standard I/O predefined functions getchar(), putchar(), gets(),
puts() and etc.
i.N
1. getchar() and putchar() functions
The predefined function getchar() is used to get a single character from keyboard and
putchar() function is used to display it.
C++ code to accept a character and display it
la
sa
da
Pa
w.
Function gets() reads a string from standard input and stores it into the string pointed by
the variable. Function puts() prints the string read by gets() function in a newline.
et
i.N
- Character functions (ctype.h)
This header file defines various operations on characters. Following are the various character
functions available in C++. The header file ctype.h is to be included to use these functions
in a program.
la
1. isalnum()
This function is used to check whether a character is alphanumeric or not. This function
returns non-zero value if c is a digit or a letter, else it returns 0.
sa
General Form:
int isalnum (char c)
Example :
da
int r = isalnum(‘5’);
cout << isalnum('A') <<’\t’<<r;
But the statements given below assign 0 to the variable n, since the given character is
neither an alphabet nor a digit.
Pa
char c = '$';
int n = isalnum(c);
cout<<c;
Output:
w.
0
ww
et
i.N
la
sa
da
3. isdigit()
Pa
This function is used to check whether a given character is a digit or not. This function
will return 1 if the given character is a digit, and 0 otherwise.
General Form:
isdigit(char c)
w.
ww
4. islower()
This function is used to check whether a character is in lower case (small letter) or not. This
functions will return a non-zero value, if the given character is a lower case alphabet, and
0 otherwise.
General Form:
et
islower(char c)
After executing the following statements, the value of the variable n will be 1 since the
given character is in lower case.
i.N
char ch = 'n';
int n = islower(ch);
But the statement given below will assign 0 to the variable n, since the given character is
an uppercase alphabet.
la
int n = islower('P');
5. isupper()sa
This function is used to check the given character is uppercase. This function will return 1
if true otherwise 0.
General Form:
isupper(char c)
da
For the following examples value 1 will be assigned to n and 0 for m.
int n=isupper(‘A’);
int m=isupper(‘a’);
Pa
6. toupper()
This function is used to convert the given character into its uppercase. This function will
return the upper case equivalent of the given character. If the given character itself is in upper
case, the output will be the same.
General Form:
w.
But, the output of the statement given below will be 'B' itself. cout <<toupper('B');
7. tolower()
This function is used to convert the given character into its lowercase. This function will
return the lower case equivalent of the given character. If the given character itself is in lower
case, the output will be the same.
General Form:
char tolower(char c)
The following statement will assign the character constant 'k' to the variable c.
char c = tolower('K’);
But, the output of the statement given below will be 'b' itself.
cout <<tolower('b');
et
* Multiplication 12 * 4 = 48
/ Division 12 / 4 = 3
i.N
% Modulus (Gives our 12 % 2 = 0
remainder of
division)
la
ii. Relational Operators:
Operator Operation Example
sa< Less than 12 < 4 is FALSE
<= Less than or equal to 12 < = 12 is TRUE
> Greater than 12 > 4 is TRUE
>= Greater than or equal to 12 > = 12 is TRUE
da
== Equal to 12 = = 4 is FALSE
!= Not equal to 12 ! = is TRUE
Pa
et
v. Conditional Operator (Ternary operator):
i.N
Operator Operation Example
?: Conditional operator largest = (a>b)? a : b ;
[ OR ]
la
b) Write a C++ program to add two distance using the following structure definition
struct Distance
{ sa
int feet;
float inch;
} d1, d2, sum;
da
Ans:
#include <iostream>
using namespace std;
struct Distance
Pa
{
int feet;
float inch;
} d1, d2, sum;
w.
int main( )
{
cout<<“ OBJECT d1: \n”;
cout<<“ \n Enter Feet:”;
ww
cin>>d1.feet;
cout<<“\n Enter inch:”;
cin>>d1.inch;
cout<<“\n OBJECT d2: \n”;
cout<<“\n Enter feet:”;
cin>>d2.feet;
cout<<“\n Enter inch:”;
cin>>d2.inch;
sum.feet = d1.feet + d2.feet;
sum.inch = d1.inch + d2.inch;
while (sum.inch > 12)
{
sum.inch- = 12;
sum.feet+=1;
kindly send me your key Answers to our email id - [email protected]
}
cout<<“\n object d1:\n”;
www.Padasalai.Net www.Trb Tnpsc.com
cout<<d1.feet<<“ feet and” <<d1.inch<<“inches \n”;
cout<<“\n object d2: \n”;
cout<<d2.feet<<“ feet and” <<d2.inch<<“inches \n”;
cout<<“\n object sum: \n”;
cout<<sum.feet<<“feet and”<<sum.inch<<“inches\n”;
cin.get( );
cin.get( );
return 0;
}
38. a) Explain detail about types of constructors and destructors with an example.
Ans: There are different types of constructors.
- Default Constructors
et
A constructor that accepts no parameter is called default constructor. For example in the class
Data, Data ::Data() is the default constructor . Using this constructor Objects are created similar
to the way the variables of other data types are created. If a class does not contain an explicit
i.N
constructor (user defined constructor) the compiler automatically generate a default constructor.
- Parameterized Constructors
A constructor which can take arguments is called parameterized constructor .This type of
constructor helps to create objects with different initial values. This is achieved by passing
la
parameters to the function.
Example:
sa
Data :: Data(int,int);
- Copy Constructors
A constructor having a reference to an already existing object of its own class is called copy
constructor. It is usually of the form Data (Data&), where Data is the class name.
da
A copy constructor can be called in meny ways:
1) When an object is passed as a parameter to any of the member functions
Example void Data::putdata(Data x);
2) When a member function returns an object
Pa
et
i.N
la
sa
da
Pa
w.
ww
- Destructors
When a class object goes out of scope, a special function called the destructor gets executed. The
destructor has the same name as the class tag but prefixed with a ~(tilde).Destructor function also
return nothing and it does not associated with anydata type.
Example:
et
i.N
la
sa
da
Pa
w.
[ OR ]
b) Debug the following C++ program.
Output
ww
et
};
class derived :: public base
{
i.N
public :
derived()
{
cout << "\nConstructor of derived ...";
la
}
!derived()
{ sa
cout << "\nDestructor of derived ...";
}
};
da
class derived :: public derived
{
public :
derived1()
Pa
{
cout << "\nConstructor of derived1 ...";
}
derived1( );
w.
{
cout << "\nDestructor of derived1 ...";
}
ww
}
int main()
{
derived1 x;
return 0;
}
et
27 Class derived1 :: public derived class derived1 : public derived
30 derived1( ); derived1( )
i.N
34 derived1( ); ~derived1( )
38 } };
la
sa
da
Pa
w.
ww