Professional Documents
Culture Documents
2. a) Which of following header files are NOT necessary to run the program given: [1]
#include <iostream.h>
#include<iomanip.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
void main()
{ char STR[80] ;
gets (STR) ;
#include<iostream.h>
#include<conio.h>
#include<ctype.h>
class Class
public:
Class(int no=1)
{ Cno=no;
section='A';
total=30;
{ section++;
total+=c;
void ClassShow()
{ cout<<Cno<<":"<<section<<":"<<total<<endl;
};
void main()
Class C1(5),C2;
C1.addmission(25);
C1.ClassShow();
C2.addmission();
C1.addmission(30);
C2.ClassShow();
C1.ClassShow();
}
c) Rewrite the following program after removing syntactical error(s) if any. Underline each
correction. [3]
#include<iostream.h>
#define MIN = 50 ;
class Help
{ int h_code;
char name[10];
public:
void IN()
{ cin>>h_code>>name;
}
void OUT()
{ cout<<h_code<<name;
}
void main()
{ Help H[MIN] ;
Help H1 = (10,Library) ;
H.h_code++;
OUT(H1);
}
d) Suggest the possible output out of the options given after the program: [2]
#include<iostream.h>
#include<stdlib.h>
const int MAX = 3;
void main( )
{ randomize ( );
int digit;
digit =80 + random (MAX );
for ( int R = digit ; R >= 80 ; R )
cout << R << $ ;
cout<<endl;
}
Possible Output Options :
(i) 83$ 82$ 81$ 80$
(ii) 80$ 81$ 82$
(iii) 80$ 81$
(iv) 81$ 80$
3. a) Define a class Fashion_Hub in C++ with the following descriptions : [4]
Private members :
A function Calc_Price() which calculates and assigns the value of Price as follows:
Ethnic_kurti 3000
Top 1500
Jeans 2500
Public Members :
A function Enter() to input the values of the data members Branch, Dress_code, Style,
Size and invoke the Calc_Price().
A function Show() which displays the content of all the data members of class
Fashion_Hub.
b) Consider the following class definitions and answer the questions given below : [9]
class Company
{ char Name[20];
protected :
double revenue;
public:
Company();
char country[15];
void enterdata();
void displaydata();
};
{ int manpower;
char F_id[4];
char city[15];
protected:
void setup();
public:
Franchise();
void add();
void show();
};
{ int outlet_no;
public:
Outlet();
void enter();
void output();
};
i) Write the names of the members, which are accessible from the object of class Outlet.
ii) Write the names of the data member, which are accessible from the function enter() of class
Outlet.
iii) How many bytes will be consumed by the object of class Outlet?
iv) Write the order of execution of constructers.
v) Write the names of the data member, which are accessible from the function enter() of class
Outlet if the class Company is privately inherited.
vi) Can we invoke enterdata() function of class company from add() function defined in
Franchise class. Justify your answer.
vii) Write the name of inheritance used above.
viii) What will be the name of inheritance if one more class named ShowRoom is defined as
shown below:-
class ShowRoom : Franchise
{ .... };
ix) What will be the visibility mode of class Franchise shown in part viii
c) Answer the questions after going through the following C++ class:
class Stream
{ int StreamCode ;
char Streamname[20];
float fees;
public:
Stream( ) //Function 1
StreamCode=1;
strcpy (Streamname,"DELHI");
fees=1000;
{ cout<<StreamCode<<":"<<Streamname<<":"<<fees<<endl;
~Stream( ) //Function 3
}
Stream ( int SC , char S[ ] , float F ) //Function 4
StreamCode=SC ;
strcpy ( Streamname , S );
fees=F ;
};
i) In Object Oriented Programming, what are Function 1, Function 4 and Function5 combined
together referred as?
[]
ii) Write definition of function 5 outside the class. Also the statement to invoke it.
[1]
iii) What is the difference between the following statements?
[1]
Stream S(11,Science,8700); // Statement 1
Stream S=Stream(11,Science,8700); // Statement 2
iv) What is the name of function 3 and when it will be invoked?
[1]
v) Write output if the main is written as shown below :-
[1]
void main( )
{ Stream S , S1(12,Arts,6700);
}
4. a) An array Z[40][30] is stored in memory along the column with each of the elements occupying
4 bytes. Find out the base address and the address of the element Z[20][15], if an element
Z[15][10] is stored at the memory location 7200. [2]
b) Write a function in C++ that takes an integer array and its size as arguments and replaces all
multiples of 10 with 100 and the rest of the elements are changed to 0. The function should return
the resultant array.
[2]
For example, if
A[10]={ 9, 56, 50, 80, 25, 4, 457, 350, 99, 100}
then the resultant array will contain
{ 0, 0, 100, 100, 0, 0, 0, 100, 0, 100}
c) Write a function REVERSE (int DVD[][5] , int P, int Q) that displays a new array R_DVD[][5] that
contains the elements of array DVD[][5] with each column in reverse order. The arrays may contain
any number of rows and columns. For example, if the content of the array DVD[4][5] is
[3]
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
16 17 18 19 20
11 12 13 14 15
6 7 8 9 10
1 2 3 4 5
5. a) Convert the following Infix expression to postfix showing stack status at each step. [2]
XY/(Z+U)*V
b) Evaluate the following postfix using stack & show the content of the stack after the execution
of each: 20 , 43 , + , 51 , - , 8 , 2 , / , 10 , * , < [2]
6. a) Observe the following Table and answer the parts (i) and (ii) accordingly
Table : MEMBER
(i) In the above table, can we take Mno as Primary Key ? (Answer in YES/NO only). Justify your
answer with a valid reason. [1]
(ii) What is the degree and the cardinality of the above table ? [1]
b) Consider the following tables STATIONARY and CONSUMER. Write SQL commands for the
statement (i) to (v) and output for SQL queries (vi) to (viii) :
[8]
Table : STATIONARY
Table : CONSUMER
(i) To display the details of those consumers who are not living in Delhi and whose consumer
name starts with letter W
(ii) To display the details of Stationary whose Price is in the range of 8 to 15. (Both values
included)
(iii) To display the ConsumerName , Address , Company and Price whose address is not
entered
(iv) Print the total number of stationary items along with maximum price per company
(v) To increase the Price of all stationary by 2 .
(vi) SELECT DISTINCT Address FROM CONSUMER ;
(vii) SELECT count(*), count(Address) , count(DISTINCT address)
FROM STATIONARY ;
7 a) State and verify the De-Morgans Theorem (Any One) algebraically . [2]
b) Write the equivalent Boolean expression for the following logic circuit :- [1]
c) Write the Sum of Product form and Product of Sum form of the function F(P,Q,R) for
P Q R F
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
F(u,v,w,x) = (0,1,3,5,7,9,10,11,12,13,14,15)
e) Draw the circuit diagram for F = ABC + CE using NAND gates only. [2]
b) State two reasons for which you may like to have a network of computers instead of
c) When a person does a crime using computer, then the person can be tracked through [1]
i) IP address
d) Which out of the following does not come under Cyber Crime ? [1]
ii) Operating someones Internet banking account , without his permission or knowledge.
iii) Entering in someones remotely and copying data , without seeking his permission
e) East and West Public Ltd. Has decided to network all its offices spread in five buildings of
Building1
[40]
Building5 Building4
[70] [60]