0% found this document useful (0 votes)
104 views5 pages

Practice Paper - 1: Time: 3 Hrs. M.Marks: 70 General Instructions

Uploaded by

Sofia Goel
This practice paper contains 8 questions assessing knowledge of various programming and computer science concepts. It includes questions on object-oriented programming concepts like inheritance and classes, arrays, linked lists, sorting algorithms, queues, Boolean algebra, and computer networking topics. The paper would require approximately 3 hours to complete and is out of 70 total marks. It contains both theoretical questions assessing conceptual understanding as well as practical programming questions to apply and demonstrate knowledge.

Copyright:

© All Rights Reserved

Available Formats

Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
104 views5 pages

Practice Paper - 1: Time: 3 Hrs. M.Marks: 70 General Instructions

Uploaded by

Sofia Goel
This practice paper contains 8 questions assessing knowledge of various programming and computer science concepts. It includes questions on object-oriented programming concepts like inheritance and classes, arrays, linked lists, sorting algorithms, queues, Boolean algebra, and computer networking topics. The paper would require approximately 3 hours to complete and is out of 70 total marks. It contains both theoretical questions assessing conceptual understanding as well as practical programming questions to apply and demonstrate knowledge.

Copyright:

© All Rights Reserved

Available Formats

Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 5

Practice Paper - 1

Time : 3 Hrs. M.Marks : 70

General Instructions :
1. All questions are compulsory
2. Attempt all questions in serial order.
3. Programming Language : C++

Q1a) What is the similarities & differences between Inheritance and containership? (2)

(b) Name the header file to be included for the use of the following built in functions (2)
(i) sqrt( ) (ii) gotoxy ( )
(iii) gets( ) (iv) cos( )

(c) Will the following program execute successfully ? if not , state the reasons : (2)
class ABC
{
int x=10; float y;
ABC ( ) { y=5; }
~ABC( ) { }
};
void main ( )
{
ABC a1,a2;
}

(d) Give the output of the following program fragment: (2)


int a=2,b=3,c=4;
a=(b++) + c;
b=a + (++c);
cout<<a<<“ ”<<c;

(e) Give the output of the following program segment : (3)


int glob=10;
void func (int &x , int y)
{
x = x – y;
y = x * 10;
cout<<x<<” , “ <<y <<”\n”;
}
void main( )
{
int glob = 7;
func( : : glob,glob);
cout << glob << “,”<<:: glob<<”\n”;
func (glob , ::glob);
cout << glob << “,” << ::glob << “\n”; }

(f) Write a C++ function having two value parameters x and n with result type float
to find the sum of series given below : (4)

1 + x + x2 + x3 + ……………….. + xn
— — — ——
2! 3! 4! (n+1)!

Q2(a) What is the difference between structure and class ? Why classes are more
useful ? (1)

(b) If a base class contains a member function basefunc( ) , and a derived class
does not contain a function with this name , can an object of the derived class
access basefunc( ) ? How show it with example . (2)

(c) Create a class called time that has separate int member data for hours , minutes
and seconds . One constructor should intialize this data to 0 , and another
should initializes to fixed values . A member function should display it ,in
11:59:59 format. The final member function should add two objects of type
time passed as arguments .
A main() program should create two initialized time objects ,and one that is not initialized . Then
it should add the two initialized values together , leving the
result in the third time variable . Finally it should display the value of this third
variable by invoking th member function. (4)
(d) Design a class called STR_FUNC which contains a string as one of its data (4)
members . Add member functions
a. Upit( ) that converts the string to uppercase.
b. Len( ) that calculates the length of the string
Also write the code in main ( ) to test these functions. ( implement string with
pointers & use pointer notation )
(e) Consider the following declaration and answers the questions given below : (4)
class WORLD
{
int H;
protected:
int S;
public:
void input(int);
void output( ) ;
};
class country : private world
{
int T;
protected :
int U;
public:
void indata(int ,int);
void outdata( );
};
class state : public country
{
int M;
public:
void display(void);
}

(i) Name the base class and derived class of the class country.

(ii) Name the data member(s)that can be accessed from function display( ) .

(iii) Name the member function(s) which can be accessed from objects of the class STATE. Is the
member function output( ) accessible by the objects of the class country.
(iv) How many bytes will be required by an object belonging to class state?

Q3(a) Comment on the efficiency of linear search and binary search in relation to
the number of elements being searched in the string. (2)

(b) Let an array contain the following elements 12,7,6,9,4,11,3 . Sort the
following elements using insertion sort showing array status after each pass. (2)
(c) For a circular queue with 5 memory locations ,show diagrammatically the status
of the queue after each of the following operations : (2)
a. 10 , 12 and then 14 is inserted
b. 10 deleted
c. 20 and 40 inserted
d. 12 and 14 deleted
e. 15 inserted and 20 deleted
f. 25 and 30 inserted
g. 40 and 15 deleted
h. 82 inserted.

(d) A circular queue is housed in an array of size N . Write C++ function to delete
an item from the front of the queue. (2)

(e) Write a program to create a linked list of ten nodes containing following
information : fight number , departure place , destination place . (2)

(f) Consider the infix expression (3)


Q : -a + b * c ˆ (d / e) + f
Translate Q into P where P is the postfix equivalent expression of Q
What will be the result of P if this expression is evaluated for :
a = 2 , b = 3 , c = 2 , d=6 , e = 2 ,f = 2

(g) An array B[10][15] is stored in the memory with each element requiring 4 bytes
of storage. If the base adres of S is 2000. Determine the location of S[5][10]
when the array S is stored by (i) Row major (ii) Column major form (3)

(h) Define a self referential structure for representing a simple linked list of integers.
Write a C++ function to split the list into two lists so that the first list contains
all even numbered position elements and the second list contains only odd
numbered position elements .For example , if the original list is
{ 2,8,1,14,6,18,0,7 } then the resultant first list would be { 8,14,18,17 }
and the second list would be { 2,1,6,0} (4)
(4)(a) Write appropriate statement to go to the beginning of a file at any time . (1)

(b) Write the difference between the open mode bits app and ate. (1)

(c) Name the base classes of fstream class. (1)

(d) Write a program which display the size of a file in bytes .Read the name of a
file from the user. (3)

(e) A data file “BATCH.DAT” contains batch code and the name of the teacher
incharge as two of its fields. Write a C++ program to do the following : (4)
(i) Adding new batch details in the file.
(ii) Determine the name of the teacher if Batch code is known.

Q5(a) State Absorption law of Boolean algebra and verify it algebraically 1

(b) Write the equivalent expression for the following logical circuit: 2

(c) Express P+Q ’R in POS form. 1

(d) Draw the circuit diagram for


F = AB’C + C’B using NAND to NAND logic only. 1

(e) Reduce the following Boolean expression using K-Map: 3


F(P, Q, R, S) = π (0,3,5,6,7, 11, 12, 15)

Q7(a) Write one advantage and one disadvantage of Ring topology? 1


(b) Write the full forms for the followings : 2
i) CDMA ii) SIM iii) MODEM iv) WLL
(c) Write one advantage of STAR topology as compared to BUS topology. 1

(d) UNIVERSITY OF CORRESPONDENCE in Allahabad is setting up the network between


its different wings. There are 4 wings named as Science (S), Journal ism (J), ARTS (A) and
Home Science (H).
Distance between various wings are given below

Wing A to Wing S 100 m


Wing A to Wing J 200 m

Wing A to Wing H 400 m

Wing S to Wing J 300m

Wing S to Wing H 100m

Wing J t o Wing H 450m

Number of Computers

Wing A 150
Wing S 10
Wing J 5
Wing H 50

i. Suggest a suitable Topology for networking the computer of all wings. 1


ii. Name the wing where the Server to be installed. Justify your answer. 1
iii. Suggest the placement of Hub/Switch in the network. 1
iv. Mention an economic technology to provide Internet accessibility to all wings.

You might also like