Qestion Paper
Qestion Paper
a)Identify the syntax errors, if any , in the following program. Also, give reason for errors. 2M
void main()
{
const int i=20;
const int *const ptr=&i;
(*ptr)++;
int j=15;
ptr=&j;
}
b)Write a function COUNT_TO() in c++ to count the presence of a word "To" in a text file
"NOTES.TXT". 3M
if the content of the file "NOTES.TXT" is as:
It is very important to know that
Smoking is injurious to health
Let us take initiative to stop it
the function COUNT_TO will display the following message:
Count of -to- in file :3
c)Give the output of the following program segment.( Assume, all required header files are included
in the program.) 3M
void main()
{
char *s="GOODLUCK";
for(int x=strlen(s)-1;x>=0;x--)
{
for(int y=0;y<=x;y++)
cout <<s[y];
cout<<endl;
}
}
d) Give the output of the following program : 2M
#include<iostream.h>
int main()
{ int a=32,*ptr=&a;
char ch='A', &cho=ch;
cho+=a;*ptr+=ch;
cout<<a<<" "<<ch<<endl;
return 0;
}
2.
a) Find the output of the following C++ code considering that the binary file GAME.DAT exist on the
hard disk with information of 200 games. 1M
class GAME
{
int Gno; char GName[20];
public:
void GetIn(); void ShowName();
};
void main()
{
fstream GF;
GF.open("GAME.DAT",ios::binary|ios::in);
GAME G;
GF.seekg(sizeof(G)*5);
GF.read((char*)&G, sizeof(G));
GF.read((char*)&G, sizeof(G));
int RECORDNO-GF.tellg()/sizeof(G);
cout<<"RECORDNO:"<<RECORDNO<<endl;
GF.close();
}
b)An array G[50][20] is stored in the memory along the row with each of the element occupying 8
bytes . Find out the memory location for the element G[10][15], if G[0][0] is stored at 4200 3M
or
or
3.
a)Write a function POPBOOK() in c++ to perform delete operation from a dynamic stack, Which
contains Bno an Title. Consider the following definition of NODE, while writing your C++ code. 4M
struct NODE
{
int Bno
char Title[20];
NODE *Link;
};
(OR)
a)Convert the following infix expression to its equivalent postfix expression, showing the stack
contents for each step for conversion
(X/Y+U*(V-W))
b) What do you understand by primary key? Give a suitable example of primary key from a table
containing some meaningful data. 2M
(OR)
b)Explain the concept of candidate keys with the help of an appropriate example.
c)Write the SOP form of Boolean function F, which is represented in a truth table as follows 1M
X Y Z F
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
(OR)
c)Define principle of duality
U V U .V UV
. U .V
(OR)
d) Draw the logic circuit for the following Boolean expression
(U V ).(W Z )
4.
a)Obtain the minimal form for the following boolean expression using karnaugh's Map:
F ( A, B, C , D) (1,3, 4,5, 6, 7,12,13) 3M
(OR)
a)Reduce the following boolean expression using K-Map:
F ( A, B, C , D) (0,1, 2, 4,5, 6,8,10)
d)Define datastructure 1M
(OR)
d)Define Cordinality
5.
6.
b) Consider the following tables SCHOOL and ADMIN and answer (a) and (b) parts of the question
6M
Table SCHOOL
Code TeacherName Subject DOJ Periods Experience
1001 Ravi Shanker English 12/03/2000 24 10
1009 Priya Rai Physics 03/09/1998 26 12
1203 Lisa Anand English 09/04/2000 27 5
1045 Yashraj Maths 24/08/2000 24 15
1123 Ganan Physics 16/07/1999 28 3
1167 Harish B Chemistry 19/10/1999 27 5
1215 Umesh Physics 11/05/1998 22 16
Table ADMIN
Code Gender Designation
1001 Male Vice Principal
1009 Female Coordinator
1203 Female Coordinator
1045 Male HOD
1123 Male Senior Teacher
1167 Male Senior Teacher
1215 Male HOD
(i)To display TEACHERNAME,PERIODS of all the teachers whose periods are more than 25.
(ii)To display all the information from the table SCHOOL in descending order of Experience.
(iii)To display TEACHERNAME ,CODE and corresponding DESIGNATION from tables SCHOOL and
ADMIN of male teachers.
(iv)To display DESIGNATION without duplicate entries from the table ADMIN.
(i) SELECT DESIGNATION, COUNT (*) FROM ADMIN GROUP BY DESIGNATION HAVING COUNT(*)<2;
(ii) SELECT MAX (EXPERIENCE) FROM SCHOOL;
7.
b)What is a protocol? Which protocol is used to copy a file from/to a remote server? 1M
c)What do you mean by network topology? What are the most popular topologies? 2M
e)Institute of Distance Learning located in Pune and is planning to go in for networking for four
wings for better interaction . The details are shown below: 4M
Number of computers
Admission wing 50
Admin wing 10
Lib wing 25
a) Suggest the type of networking (LAN,MAN,WAN)for connecting Lib Wing to Admin Wing , Justify
your answer
b)Suggest the most suitable place (i.e. wing)to house the server, with a suitable reason.
a)Repeater b)Switch
d)The Institute is placing to link its study centre situated in Delhi. Suggest an economic way to
connect it with reasonably high speed .Justify your answer .