Sample Paper1
Sample Paper1
Sample Paper1
Maximum Marks: 70
Ques. 1.
a) Differentiate between Run Type and Syntax error with example.[2]
b) Name the header files that shall be needed for the successful
execution of following code:
[1]
void main()
{char Word[]=Exam;
cout<<setw(20)<<Word;
}
c) Rewrite the following program after removing syntactical error(s)
if any and underline each correction:
[2]
#include iostream.h
class MEMBER
{ int Mno; float Fees;
PUBLIC:
void Register ()
{ cin>>Mno>>Fees; }
void Display()
{ cout<<Mno<<" : "<<Fees<<endl; }
};
void main()
{
MEMBER delete;
Register();
delete.Display();
}
d) Give the output of the following program segment:
void main()
{
char *NAME=No ExPeRt!;
for(int x=0;x<strlen(NAME);x++)
if(islower(NAME[x]))
NAME[x]=toupper(NAME[x]);
else if(isupper(NAME[x]))
if(x%2!=0)
NAME[x]=tolower(NAME[x-1]);
else
NAME[x]--;
cout<<NAME<<endl;
}
e) Find the output of the following program:
#include<iostream.h>
void Withdef(int HisNum=65)
{
for(int I=40;I<=HisNum;I+=5)
cout<<I<<,;
cout<<endl;
}
void Control(int &MyNum)
[2]
[3]
MyNum+=40;
Withdef(MyNum); }
void main()
{
int YourNum=10;
Control(YourNum);
Withdef();
cout<<Number=<<YourNum<<endl;
}
f) In the following program, find the correct possible output(s) from
the options. Justify your answer.
[2]
#include<iostream.h>
#include<stdlib.h>
void main( )
{
randomize();
int p=99,q=999;
int x=random(3)+4;
int y=random(2)+2;
for(int i=0;i<x;i++)
cout<<#;
cout<<p<<-;
for(i=0;i<y;i++)
cout<<@;
cout<<q<<endl;
}
i- ##99-@999
ii- ##99-@@999
iii- ######99-@@999
iv- ####99-@@@
Ques.2.
b) Write the output of the following C++ code. Also,name the feature
of OOP jointly illustrated by the functions (i) to (iv):
[2]
#include <iostream.h>
void Line( )
//Function i
{
for (int L=1; L<=80; L++) cout<<-;
cout<<endl;
}
void Line(int N)
//Function ii
{
for(int L=1; L<=N; L++) cout<<*
cout<<endl;
}
void Line(char C, int N)
//Function iii
{
for(int L=1;L<=N;L++) cout<<C;
cout<<endl;
}
void Line(int M, int N)
//Function iv
{
for(int L=1; L<=n;L++) cout<<M*L;
cout<<endl;
}
void main()
{
int A=9,B=4,C=3;
char K=#;
Line(K,B);
Line(A,C);
}
c) Define a class STATE in C++ with following description :
Private members :
[4]
Name of state (type string)
Population (long int)
Number of girls under 16 years of age attending school (long int)
Total number of girls under 16 years of age (long int)
A member function CALC_PER( ) to calculate & return the
percentage of girls attending the school as ( Number of girls
attending the school/Total number of girls * 100 )
Public members :
A constructor to initialize name of the state as NOT ALLOTTED
A function INSTATE() to enter data for all data members
A function OUTSTATE( ) to view the contentS of all the data
members along with the percentage of girls attending the school.
d) Read the following class declaration and answer the questions from
(i) to (iv) :
[4]
class Kitchen_Products
{ char Model_No[15], C_Name[30]; int year;
protected : auto float marks;
public:
void Get_It( );
void Show_It( );
};
class Fridge: public Kitchen_Products
{ protected:
int Capacity;
long Price;
char Color[12];
public:
void Read_It( );
void Print_It( );
};
class Stock : protected Fridge
{
int Stock_In_Hand;
public:
int Sold_Num;
void Get_Data( );
void Dis_Data( );
}FRIDGE;
void main( )
{ . . .
}
i)
ii)
void In()
{ cin>>Tno; gets(src); gets(dest); }
void Show()
{ cout<<Tno<<:<<src <<: <<dest<<endl; }};
QUES.5.
a) What do you mean by Projection in RDBMS? Explain by example.
[2]
b)Study the following tables MEMBERS and SALARY and write SQL commands
for the questions (i)-(iv) and give outputs for SQL queries (v)-(vi):[6]
TABLE: MEMBERS
TABLE:
ID
BASIC
ALLOWANCE
COMMISSION%
101
12000
1000
104
23000
2300
107
32000
4000
114
12000
5200
10
109
42000
1700
20
105
18900
1690
130
21700
2600
30
SALARY
[2]
b) Draw the equivalent logic circuit diagram for the following Boolean
Expression using NAND gates only: XY + XZ
[2]
c) Write the POS form of a Boolean function H, which is represented in a
truth table as follows:
[1]
A B C H
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
d) Reduce the following Boolean Expression using KMap:
[3]
F(P,Q,R,S) = (1,2,3,5,6,7,9,11,12,13,15)
Q 7. a) What are firewalls?
[1]
[1]
[1]
[2]
[1]
Jodhpur office
office
Udaipur office
kota office
Ajmer
office
30 m
40 m
25 m
Udaipur to Ajmer
Jodhpur to Ajmer
Udaipur to Kota
In continuation of the above,
install the following number of
Udaipur
40
Jodhpur
80
Kota
200
Ajmer
60
150 m
105 m
60 m
the company experts have planned to
computers in each of their offices: