0% found this document useful (0 votes)
12 views8 pages

2018 June

This document is an examination paper for Computer Science, subject code H705, with a total of 28 questions divided into four sections, covering various topics in C++. It includes multiple-choice questions, programming tasks, and theoretical questions, with specific instructions for each section. The exam duration is 2.5 hours and the maximum marks are 55.

Uploaded by

tejs00001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

2018 June

This document is an examination paper for Computer Science, subject code H705, with a total of 28 questions divided into four sections, covering various topics in C++. It includes multiple-choice questions, programming tasks, and theoretical questions, with specific instructions for each section. The exam duration is 2.5 hours and the maximum marks are 55.

Uploaded by

tejs00001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

*H705*

2018 VI 08 0930 Seat No. :

Time : 2½ Hours COMPUTER SCIENCE


(New Pattern)

Subject Code

H 7 0 5

Total No. of Questions : 28 (Printed Pages : 8) Maximum Marks : 55

INSTRUCTIONS : i) All questions are compulsory, however there is an internal


choice for question number 22, 27 and 28.
ii) Question number 1 to 5 should be attempted only once.
iii) Programs should be written in C++ Only.
iv) State your assumptions clearly.
Section A : Consists of 10 questions of 01 mark each.
Section B : Consists of 11 questions of 02 marks each.
Section C : Consists of 05 questions of 03 marks each.
Section D : Consists of 02 questions of 04 marks each.

SECTION – A

1. Write the CORRECT alternative from those given below : [1]


Wrapping of data and functions that operates on data together in a single entity
class is called
• Encapsulation
• Polymorphism
• Data abstraction
• Inheritance

2. Write the CORRECT alternative from those given below : [1]


The process of inserting new node on stack is
• POP
• PUSH
• INSERT
• ADD

H-705 -1- P.T.O.


*H705*

3. Write the CORRECT alternative from those given below : [1]


Which are the file modes that take the put pointer to the end of the file when file is
opened ?
• ios :: app & ios :: ate
• ios :: app & ios :: trunc
• ios :: ate & ios :: in
• ios :: in & ios :: out

4. Write the CORRECT alternative from those given below : [1]


Identify the Demorgan’s law from those given below
• A + AB = A
• A+ A =1
• A + B = A B

• A B = A B

5. Write the CORRECT alternative from those given below : [1]


A user can get files from another computer on the internet by using
• HTTP
• TELNET
• FTP
• UTP
6. What are inline functions ? [1]
7. What is a linked list ? [1]
8. State any one points of difference between linear linked list and one dimensional
array. [1]
9. What is a Router in computer network ? [1]
10. What is the purpose of modem in computer network ? [1]

SECTION – B
11. Determine the output of the following program [2]
# include < iostream.h >
# include < conio.h >
Class player
{
H-705 -2-
*H705*

int score, level ;


char Game ;
Public :
Player (char GGame = ‘A’)
{score = 0, level = 1, Game = GGame ; }
Void start (int sc) ;
Void next ( );
Void disp ( )
{
Cout << Game << “@” << level << Score << end c ;
}
};
Void Player :: next ( )
{ Game = (Game == ‘A’) ? ‘B’ : ‘A’) ; }
Void Player :: start (int sc)
{
Score + = sc ;
if (score > = 100)
level = 3 ;
else
if (score > = 50)
level = 2 ;
else
level = 1;
}
void main ( )
{
Player P, Q (‘B’) ;
P. disp ( ) ;
Q. start (75) ;
Q. next ( ) ;
P. start (120) ;
Q. disp ( ) ; P (disp) ;
Player r ; r. disp ( ) ;
}
12. Write any four characteristics of constructor. [2]

H-705 -3- P.T.O.


*H705*

13. Consider the following declaration [2]


int sparse (int X[ ] [10], int r1, int c1, int y [ ] [3])
{

}
Where x is a matrix of order r1* c1, obtain the matrix y as the sparse of matrix x.
The function return’s total number of non zero elements.
14. Differentiate between actual arguments and formal arguments. [2]
15. Obtain the Postfix expression for the following infix expression. Show the contents
of the stack after each step.
A + B * C + D/E [2]
16. State any two points of difference between text file and binary file. [2]
17. Write a user defined function in C++ to count and return the number of Alphabets
in a text file named “sample.txt”. [2]
18. Prove the following Boolean expression using, Boolean laws. [2]
(x + y).(x + z).(y + z) = (x + y)(x + z)
19. Write the equivalent Boolean expression for the following logic circuit diagram
and reduce the Boolean expression into its simplified form using laws of Boolean
algebra. [2]

20. Write a short note on Bus Topology. [2]


21. State two points of difference between LAN and WAN. [2]

H-705 -4-
*H705*

SECTION – C
22. Write a complete procedural C++ program ro generate the following pattern for N lines.
If N = 4. [3]
1 1
2 2
3 3
4
OR
22. Write a complete procedural C++ program to generate the following pattern for N lines
If N = 4. [3]
* * * * *
* * * *
* * *
* *
*
23. Write a user defined function named display ( ) in C++ to print the first N binary
numbers, where N is passed as the argument to the function. (without using
array)
If N = 5 then function should display 0, 1, 10, 11, 100. [3]
24. Define a class REPORT in C++ with the following description. [3]
Private members :
• stream array of 10 characters
• rno of type integer
• name array of 30 characters
• div 01 character
• grade 01 character
• remark array of 30 characters
• getremark ( ) function which assigns remark based on the following conditions
Remark Condition
“Quality for next class” If students secures a grade from ‘A’ to ‘G’
“Needs improvement” If Students secures ‘H’ or ‘I’ grade

H-705 -5- P.T.O.


*H705*

Public :
• input ( ) function to ask and store the value of rno, name, class, div, grade
and called getremark ( ) function to assign remark.
• Display ( ) function to display all the data members neatly and clearly.
25. Given a binary file “Employee. DAT” containing records of the following class
type. [3]
Class EPL
{
Char Name [20] ;
Char Address [20] ;
Char Dept [20] ;
float salary ;
Public :
Void input ( ) ;
Void show ( ) ;
float check ( )
{
return salary ;
}
int shield (char s [ ] )
{
return strcmp (Dept, s) ;
}
};
Write a function club ( ) in C++ that would copy all those records which are
having Dept as “PERSONEL” and salary more than 50,000/- from
“EMPLOYEE.DAT” to “FINAL. DAT”.
26. Obtain a simplified form for the following expression using K-map.
f (A, B, C, D) = ∑ (1, 2, 3,5,6,7,9,11,12,13,15 ) . [3]
Also draw the logic circuit diagram for the simplified expression using NAND
gates only.
SECTION – D
27. Define a abstract class named “BASE 1” having one private data member ‘X’ of
integer type and parameterised constructor to initialise data member ‘X’ only.
Define another abstract class named “BASE 2” having two private data members
H-705 -6-
*H705*
‘Y’ of type float and ‘Z’ a character array of size 20. Define parameterised
constructor to initialise its data members ‘Y’ and ‘Z’. Derived a new class named
“SWEET” from BASE 1 and BASE 2 in public mode. It consists of one protected
data member ‘W’ of type character and parameterised constructor to initialise
data member ‘W’.
Write an appropriate main ( ) function which creates derived class object. [4]
OR
27. Define a class named “EGG” with the following specification.
Private :
• doz of type integer.
• no of type integer.
• Define a default constructor which accepts values for all the data members.
• Define a copy constructor which accepts two objects as parameters and
initialises data members as per the summation of dozons of both the objects
(Refer example below)
• Define member function show ( ) in public visibility label to display vlaues of
data members of all the objects. Further write appropriate main ( ) function.
Example :
if obj 1 is 3 doz 8 numbers
obj 2 is 4 doz 6 numbers
obj 3 is 8 doz 2 numbers
28. Consider the following class declaration [4]
class LIST
{
Struct node
{
int age ;
node * Link ;
} * START ;
Public :
LIST ( )
{ START = NULL ; }
void create ( ) ;
void insert ( ) ;
void display ( ) ;
};
Write the function definition for the member function insert ( ) to insert a new
node at any position in the linked list. Assume that the linked list contains N
nodes.
OR

H-705 -7- P.T.O.


*H705*

28. Consider the following class declaration


class LIST
{
Struct node
{
int age ;
node * link ;
} * Start ;
Public:
LIST ( )
{
Start = NULL ;
}
void create ( ) ;
void delet ( ) ;
void show ( ) ;
};
Write the function definition for the member functions delet ( ) to delete node
at any position and function show ( ) to display the contains of linked list.

–––––––––––––––––

H-705 -8-

You might also like