Computer Science 12th
Computer Science 12th
SOLVED PAPER – I
1. Accuracy: Computer always give 100% rate result, it never give wrong result.
Ans. My Computer: My Computer is the entry point of your computer's folder structure
and resources. My computer is the most important Desktop item.
Ans. EDI stands for Electronic Data Interchange. EDl refers to Computer to Computer
Exchange business document in a standard and agreed formed. EDI is the key to
paperless office. EDI has become major means of business communication among large
campaign in USA.
Ans. FTP: FTP stands for File Transfer Protocol, is an internet utility software used to
upload and down load files.
(a) What are the five basic activities performed in data processing?
(ii) Conversion: Once the data is collected, it is converted from its sources documents
to a form that is more suitable for processing. Conversion of data includes the following
activities.
hard copy.
4. It allocates main memory and other storage areas to the computer system programs
as well as users programs and data.
(c) Name the characteristics of Java programming language. Explain any one of
them?
Explain:
1. Java Simple and Small: Java is simple because the Complicated Features of C++like
pointers, operator overloading and multiple inheritance are not included in Java. Thus it
is easy to learn program in Java. Java's component is small in size and complexity in
comparison to other development tools.
(a) What is topology? Name some common network topologies? Explain any of
them?
topology. Bus, Star and Ring are a few names of common topologies.
1. Bus Topology
2. Star Topology
3. Ring Topology
Explanation of one.
Star Topology: In star topology each node is connected to a central files server though
their independent and dedicated cable. The cables of all the nodes are connected to the
file server though hub. Hub is a device that serves as the central point where cable of all
the nodes is connected. Hub accumulates the information flow and then distributes
Star network is frequently used to connect one or more small computer or peripheral
devices to a large local computer or CPU. Star topology or its variation is used by much
organization in a time sharing system.
(b) Write a program using pointers to prints all the values of an integer array x
having four values as 10, 20, 30, and 40. 10, 20, 30, 40.
Ans.
Void main ()
Into a [5], i;
For (i=1;i<5++)
a [i] -5 x 1:
Ans. Size of ( ) operator is used to find the number of bytes, occupied by a variable or
constant in the memory
(b) What are literals? Name the various types of literals in C++?
Ans. Literal are such indentifies, whose value do not change during the execution of a
program, while literal or constant remains same at the time of program execution
(d) String-Constants
Ans. Logical Operators: Logical operators are used to combine two or more relational
expressions. There are three logical operators in C++ and they are,
(ii) :: OR operator
(d)Assume the variable total starts with the value 10. What will be the output of
Ans. The act of partitioning a program into individual and independent modules or
components is called modularity.
combining both data and function that operates data, under a single unit and this unit is
called a class. The data of a class only be accessed by the function of the class. Soft is
not possible to access the data of a class directly. In this way data number of a class
become safe are considered far away from accidental alteration.
(a) What will be the value of variable x after the execution of the following
program?
Ans.
Void main ( )
int x;
int digit = 0;
x=1
{++x
++ Digit :}
C out<<x;
Value of variable 12
(b) Explain the operation of 'if else statement in C++ with the help of a flow
diagram?
Ans. This is an extended form of simple if statement. Using this statement user can
Format
If (Condition)
Statement l;
Else Statement 2;
e.g.
a = 25;
b = 15;
If (a >b)
Else
In the above example, if the condition is true then the statement written after eise will
be executed.
Ans. Token: A Token is a group of character that conveys some meaning to the
compiler when presented in a lien of program. C++ uses following types to token.
(i) Keywords
(ii) Identifiers
(iii) Literals
(iv) Punctuators
(v) Operators
may behave ferently on different class. The behavior depends on the types of data used
in the operation. For example the Operator may have a polymorphic behavior. It
Produce a sum of given two numbers whereas if the operands are strings them it will
produce a third ting by concatenating them.
Void main ()
{Int x;
Cin >> x;
8 - Expreation syntax
Q. 6 (a): Identity the header file (s) for the following built in functions:
Ans. Put Char (): This function is used to display the inputted character on the screen.
This function too is available in stdio.h header files. .
For example.
#include <stdio-h>
Void main ()
Char x;
X = get char ()
Ans. The variables which are declared within the body of a function are called local
variables. A local variable has a local scope, i.e., it can be used only in that function in
which it is declared. The portion of the program in which a variable is retained in the
The variables which are declared outside any function are known as global variable. A
global variable can be used any function. Generally global variable are declared at the
Struet student
Q. 7. Write a program that will accept a 1 character grade code and depending on
this grade code the employee is display as per the following table.
A. 50,000
B. 30,000
C. 0,000
# include <ctye.h>
All Rights reserved © Manish Verma : NIOS Channel, Visit https://manishvermaofficial.com/
14
Void main ()
char ch;
Case A':
Cout<<"Salary is 50,000";
break;
Case 'B';
Break;
Case 'C'
Break;
Default:
Ans. An enumerated data type is that which can hold a finite list of value that a data
type can take. An enumerated variable is declared by using enum key board for
example, errúm month {Jan, Feb, March, April} enum days [Sun, Mon,Tue, Wed, Fri]
class has been defined, we can create any number of objects associated with the class.
Ans. Object: An entity that has some characteristics is called an object In real world an
object simply exists, but with in a programming language each object has a unique
handle by which it can be uniquely referenced. In real world a book, a copy, a pen, a bus,
a car, etc. are object but in a programming language a window, a button, a scroll bar
etc. are object which are; of their relevant class. In programming world interact by
sending message to one another and interact without having to know the details other's
data or code.
Ans. Abstract Class: An abstract class that be used to create objects. An abstract class
acts a class and can be inherited by other class’s derived class.
from which a new class: A from the inherited feature, a new class may contain i own
All Rights reserved © Manish Verma : NIOS Channel, Visit https://manishvermaofficial.com/
16
features too. In this way every class contain the features of both the classes. Inheritance
allows. Existing classes to be adapted to new application without the need for
modification.
Ans. By specifying the relationship of derived class with the base using the visibility
mode, we can define a derived class. The new class is called derived class.
(c) Name the input and output pointers used in the file operations.
(1) Ios:: app : The ios :: app mode allow only addition of record at the end of life.
(i) Ios:: ate: The ios : ate mode allow addition and modification of record anywhere in
the fire.
(e) Define a 2 dimensional array X having 2 raws and 6 columnist of the int data
type.
Solved paper II
Ans. (a) A bar code reader is a photoelectric Scanner that reads the bars of varying
thickness and convert them into electrical pulses to be processed by a computer.
(b) 3D Audio is a technology that enables a computer system to position sounds all
around a listener. We use the term 3D Audio to describe a much more sophisticated
system that can ideally position sounds anywhere around a listener.
(c) Data processing cycle is a continuous series 3. Four events: inputting of data,
processing of data, generation of output and storing of data.
(b) An operating system is system software that manages the hardware resources of a
computer system and establishes an interface between hardware and user to enable
his/her to work with computer.
(d) Bandwidth refers to the range of frequencies that is available for transmission of data
second).
3. (a) Name the various ways of getting connected to the Internet. What do we need for
Ans. (a)
* Gateway access
* Dial-up connection
* Shell connections
* TCP/IP connection
* Leased connection.
* a computer.
* a MODEM
* a telephone connection
(b) No doubt, Java is derived from C and C++; but its features are less complicated than
C And C++. For example, Java does not support pointers, which is confusing and rarely
used feature of C and C++. Instead of pointers, Java supports tightly bounded array that
criminates the possibility of over writing memory and corrupting data unwillingly.
C and C++ supports structure and enums, while Java does not uses automatic
garbage collector to allocate and dellocate (free) memory for objects on as and when
required basis.
In C++, programmers need to specify the allocation and deallocation of memory for
Java does not support multiple inheritance whose smantic and usage has been
Java compiler produces Bytecode that can be run on any machine on which JVMC Java
Virtual Machine) has been installed: while C++ compiler produces executable codes that
(c) All are data transmission modes. In simple mode of transmission, data can be
transmitted only in one direction. FM radio uses this mode of communication. In Half-
Duplex mode data can be transmitted in both directions over the communication
channel, but only in one direction of a time. In full-Duplex mode data can be
transmitted in both directions over the communication channel at the same time.
Telephone lines use this mode of communication.
(d). Assume the variable sum starts with the value 26. What will be the output of
the following code?
(c) The punctuator character braces '( )' in C++ is used to indicate a block of code in a
program for compiler. Opening brace'(‘indicates beginning and closing brace--
(d) 21
the value of sum will be not decreased by one (at first occurrence as it uses post
(e) Polymorphism is derived from two Latin words. Poly and Morphos. Poly means many
and Morphos means forms. Thus Polymorphism is feature that allows one interface to
(f) Abstraction is the act of representing essential features of an object without including
of knowing the background details of object. All the object oriented programming
(g) Inheritance is a process by which one object entity acquires the properties/features
of another object/entity. The concept of Inheritance is applied in all objects oriented
languages to derive (create) a new class from an existing class. The class from which a
new class is created/derived is called basa class and the class which is created/derived
(b) Explain the operation of do-while loop in C++ with the help of a flow diagram.
#include <iostream.h>
X=1
{sum = X+;
x++;}
Ans. (a) When a line in the program contains only a semicolon character ( ; ), it is called
a null or empty statement. Null statement is quite useful when the syntax of the
language needs to specify a statement but the logic of that does not need any
statement A Null statement is generally used in for and while loon statement
Do
Statement 1;
Statement 2;
Statement n :}
} While (condition)
In do-while loop the statements written on do and while are executed first and then the
condition is tested. If the condition evaluates to TRUE the body of the loop (statements
written within do and while) executes again. The condition is tested for each execution
of the body of the loop. The body of loop executes continuously, until the condition
does not evaluate to FALSE. Thus the body of loop at least executes once in do-while
loop.
(c) The order of precedence from highest to lowest for all the operators available in C++
is given below:
Category Operators
Multiplicative *,/,%
Additive +,-
Relational <,>,<=,.=
Equality ==,!=
Conditional AND $$
Conditional OR II
II
Ternary (conditional) ?:
Assignment =
Comma operator ,
(d) The main function is empty, and invalid; because of function must, be defined with a
opening parenthesis-'C' and a closing parenthesis - )'. If it is defined with 'O' then it
becomes valid, but an empty function, because its body contains no statement. The
Is not ended with a semicolon character ';'. Thus the correct program will be:
#include <iostream.h>
Imain ():
int x, sum = 1
Sum = X+;
X ++;
(i) Getchar ( )
(ii) Getchar ()
(iii) Exp ()
(iv) Strepy ()
Ans.
(i) Stdio.h.
(ii) Conio.h
(iii) Math.h
(iv) String.h
(b) A Local variable is that which is declared inside the block of a function or compound
statement whereas a Global variable is de cleared before the main () function. The scope
of Local variable is over when the control goes out of the block in which it was created
whereas the scope of a Global variable is over only when execution of the program is
terminated
All Rights reserved © Manish Verma : NIOS Channel, Visit https://manishvermaofficial.com/
27
overloading is a concept in which functions having the same name perform different
tasks.
Ans.
#include <iostream.h>
Void main ()
Initial = 0;
Final = N-1:
final = mid - 1;
else
initial = mid + 1;
(b) Write the general format of typedef statement stating its purpose.
#include <stdio.h>
Void main ()
{
All Rights reserved © Manish Verma : NIOS Channel, Visit https://manishvermaofficial.com/
29
d1 = = 'jan';
d2 == 'may';
Ans. (a) When a structure is used within another structure, it is called nesting of
structure.
The typedef keyword is used to define a new data type for an exising data type. The
new defined data type is also known as user defined data type. This provides an
Here, dot (.) is called 'member operator' which accesses the value of specified data
member. (d) There is a similar error in lines 6 and 7, because equality checking operator
Q.9. (a) State whether the statements given below are True (T) or False (F):
(i) A constructor is a special member function whose name is the same as class
name.
(ii) A member function cannot be called inside another member function of same
class.
(i) The feature that new class can use some of the properties of old class is known
as……………….
(iii) The data in ……... section of the base class cannot be inherited.
Q.10. Write a program using pointers to print all the values of an integer array X
having four values as 20, 25, 30, 40.
Voidmain ():
Q.11. (a) If both input stream and output stream are used in the same program,
(b) Name the two inputs and output pointer used in file operations.
(d) Define a two-dimensional array twoD having two rows and six columns of the
int data type.
Ans.
(a) isotream.h
(b) Two input and output pointers used in file operations are: gat and put.
(c) (I) ios:: ate is a file mode parameter that positions the file pointer at the end of file
and a lows modification of data anywhere in the file addition of data at the end of file.
(II) ios:: nocreate is a file mode parameter That opens a file, only if the file exists but
does not create a new one. If the file already exists, it opens the file; otherwise if fails to
Ans. OCR stands for optical character reader that can read text and number from the
paper and translate them into computer understandable form, OMR stands for optical
mark reader which can sense the presence or absence of a mark, such as pencil mark.
Ans. Add/Remove program is one of the features of Control Panel that enable you
install a program such as MS-Word on your computer. You can also remove an installed
program from your computer by using this feature.
Ans. A logical record contains all the data related to a single entity, whereas a physical
record refers to a record whose data fields are stored physically next to one another.
(e) List the basic types of networks on the basis of geographical coverage.
Ans. On the basis of geographical coverage the basic types of networks are - LAN (Local
Area Network) and WAN (wide Area Network).
Ans. System software is a set of such instructions that directly interacts with computer
hardware and help the application software to excute (run).
Ans. CD-ROM is a compact disk, read-only in nature with very high storage density and
fast access time. WORM stands for Write Once Read Many, is a disk on which you can
write data permanently by using keyboard, video scanner, OCR equipments and other
devices.
Ans.
business information using Electronic Data Interchange, Electronic mail, Electronic Fund
Ans. FTP stands for File Transfer Protocol, is Internet utility software used to upload and
download files. JVM stands for Java Virtual Machine which is an interpreter that takes
the byte code of a Java program and convents it into the specific machine code for the
Ans.
(ii) Architecture-neutral
(ii) Portable
(iv) Dynamic
(v) Distributed
(vi) Robust
(vii) Secured
(viii) Multi-Threaded
4. (a) what are Tokens? Name various types of tokens in C++. Explain the function
Ans. A token is a group of characters that logically belong together. Various types of
tokens in C++ are - keywords, identifiers, literals, punctuators and operators. For
example, int is a keyword of C++, which is a data type of C++, which occupies two bytes
in memory and can hold integer data/values from the range-32768 to 32767. 2)
(b) Arrange in the lowest to highest order of data types: long, char, float, and
double, int, long, double.
(c) Write an expression involving a logical operator that is true if limit is 45 and
speed is greater than 45.
(ii) Develop a palomorphic behavior function that reacts differently on different instance
of objects.
Q.6. (a) Name the Selection Control Structure ss. ment in C++. Write the syntax of
switch ment.
Ans. (i) If
Default; statements;
(b) Write a while loop that displays the nu bers from 10 to 100.
i++;
(c) Write a program that will accept a character grade code and depending on
Grade Salary:
A 20,000
B 15,000
C 10,000
Char ch;
Switch (ch)
Break;
Case ‘C’:
Break;
Default:
Ans. A local variable is that which is declared inside the block of a function or
compound statement where as a global variable is declared before the main () function.
The scope of local variable is over when the control goes out of the block in which it was
declared whereas the scope of a global variable is over only when the execution of
program is terminated,
// table.cpp
#includes <iostream.h>:
Void main ()
Starline ();
Void starline ()
<< **.
Cout<<endl;
Ans.
****************************************************************************************
********************************************************************************************
Char-128 to 127
********************************************************************************************
Q. 8. Do as directed:
Ans. The subscript or index number of an array is used to access the elements of an
array.
(b) An array is a collection of elements of the same data types (Fill in the blank)
(d) Write a statement that defines one-dimensional array called employees of type
int that can hold 10 data elements.
(e) Define a two-dimensional array twoD having 3 rows and 4 columns and stores
int data type.
Ans. The typedef statement is used to define a user defined data type from an existing
data type.
For example
Decimal salary;
(b) Write a structure specification that includes three variables -- all of types int-
called hrs, mins and secs. Call this structure time.
}:
Ans. A constructor is a special type of function which has the same name of a class in
which it is declared.
Float length;
Float width;
………………...
…………………
......................
};
Ans.(i) Single inheritance- In this form a single class derives the properties of a base
class. ...
(ii) Multiple inheritances - In this form a new class inherits properties of more than one
class.
(iii) Multilevel inheritance - In this form a derived class inherits the properties of another
de rived class.
(iv) Hierachical inheritance - In this form one class may be inherited by more than one
class.
(c) Write a statement that displays the address of the variable testvar.
(e) What is the difference between inparr (5) and * (inparr + 5]?
Ans. inparr [5] returns the value stored in the 6th element of inparr array, whereas *
(inparr + 5) return the value stored at inappr + 5), where inpaar is a pointer to array that
holds: · the address of inappr (O), that is, & inappr [0].
If stream infile;
Ans. The first statement: stream infile; will create an stream object called infile of type if
stream class.
Will call the open () member function of object infile, an instance of if stream class and
the open () function will open the ABC file in input/output mode and places the file
pointer at the end of file. The third and last statement.
Will assign the size of file in B. aš telg () function will return the last byte position
number of the file.