2018 June
2018 June
Subject Code
H 7 0 5
SECTION – A
• A B = A B
SECTION – B
11. Determine the output of the following program [2]
# include < iostream.h >
# include < conio.h >
Class player
{
H-705 -2-
*H705*
}
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]
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
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 -8-