0% found this document useful (0 votes)
96 views27 pages

CS (Old)

The document provides instructions for a test with 7 questions split into 3 sections. It specifies that candidates must write their code number on the title page and provide the question number for each answer. The test allows 3 hours and has a maximum score of 70 marks. Section A is for candidates who chose C++, Section B is for those who chose Python, and Section C is compulsory for all.

Uploaded by

ram prakash
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)
96 views27 pages

CS (Old)

The document provides instructions for a test with 7 questions split into 3 sections. It specifies that candidates must write their code number on the title page and provide the question number for each answer. The test allows 3 hours and has a maximum score of 70 marks. Section A is for candidates who chose C++, Section B is for those who chose Python, and Section C is compulsory for all.

Uploaded by

ram prakash
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/ 27

Code No.

491/C
Candidates must write the Code on the
Roll No.
title page of the answer-book.

 Please check that this question paper contains 27 printed pages.


 Code number given on the right hand side of the question paper should be
written on the title page of the answer-book by the candidate.
 Please check that this question paper contains 7 questions.
 Please write down the Serial Number of the question in the answer-book before
attempting it.
 15 minute time has been allotted to read this question paper. The question
paper will be distributed at 10.15 a.m. From 10.15 a.m. to 10.30 a.m., the
students will read the question paper only and will not write any answer on the
answer-book during this period.

COMPUTER SCIENCE (OLD)


Time allowed : 3 hours Maximum Marks : 70

General Instructions :
(i) SECTION A refers to programming language C++.
(ii) SECTION B refers to programming language Python.
(iii) SECTION C is compulsory for all.
(iv) Answer either SECTION A or SECTION B.
(v) It is compulsory to mention on page 1 in the answer-book whether you are
attempting SECTION A or SECTION B.
(vi) All questions are compulsory within each section.
(vii) Questions 2(b), 2(d), 3 and 4 have internal choices.

.491/D 1 P.T.O.
SECTION A
[Only for candidates, who opted for C++]
1. (a) Identify the valid keywords in C++ from the following : 2
(i) If
(ii) for
(iii) case
(iv) Object
(v) struct
(vi) sub
(vii) float
(viii) My_class
(b) Write the names of the correct header files, which must be included
in the following C++ code to compile the code successfully : 1
void main()
{
int X = random(10);
int Y = random(20);
cout<<"sum of "<<X<<" and "<<Y<<" = "<<X+Y<<endl;
}
(c) Rewrite the following C++ program after removing any/all
syntactical errors with each correction underlined : 2
Note : Assume all required header files are already included in the
program.
void main()
{
cout<<"Enter two integers";
cin>>A>>B;
if A <= B
A += B;
B –= 5;
else
{
B = B + A;
A – 5 = A;
}
cout<<A<<" : "<< B << Endl;
}
.491/D 2
(d) Find and write the output of the following C++ program code : 2
Note : Assume all required header files are already included in the
program.
void ChangeVal(int *M, int N)
{
for(int i=0;i<N ; i++)
{
if (*M%5 == 0)
*M /= 5;
if (*M%3 == 0)
*M /= 3;
M++;
}
}
void main()
{
int Val[]={25,8,75,12};
ChangeVal(Val,4);
for(int i=0;i<4; i++)
cout<<Val[i]<<"*";
cout<<endl;
}
(e) Find and write the output of the following C++ program code : 3
Note : Assume all required header files are already included in the
program.
struct Product
{
int X, Y;
};
void Change(Product &P)
{
P.X += 5; P.Y –= 5;
}
void Multiply(int P1, int P2)
{
cout<<"First = "<<P1<<" & Second = "<<P2<<endl;
cout<<"Product = "<<P1*P2<<endl;
}
void main()
{
Product P[] = {{7,10},{10,7},{7,7}};
for(int i=0; i<3; i++)
{
Change(P[i]);
Multiply(P[i].X, P[i].Y);
}
}
.491/D 3 P.T.O.
(f) Look at the following C++ code and find the possible output(s) from
the options (i) to (iv) following it. Also, write the minimum and
maximum values that can possibly be assigned to the variable End. 2

Note :

 Assume all the required header files are already being included in
the code.

void main()

randomize();

char Colours[][20] = {"VIOLET","INDIGO","BLUE","GREEN",


"YELLOW","ORANGE","RED"};

int End = random(2)+3;

int Begin = random(End)+1;

for(int i= Begin; i<End; i++)

cout<<Colours[i]<<"&";

(i) INDIGO&BLUE&GREEN& (ii) VIOLET&INDIGO&BLUE&

(iii) BLUE&GREEN&YELLOW& (iv) GREEN&YELLOW&ORANGE&

2. (a) Explain Single level inheritance in context of Object Oriented


Programming in C++. Also, write a suitable example in C++ to
illustrate Single level inheritance. 2

.491/D 4
(b) Observe the following C++ code and answer the questions (i), (ii),
(iii) and (iv) : 2
Note : Assume all necessary files are included.
class Triangle
{
int S1,S2,S3;
public:
Triangle(int X=0, int Y=0, int Z=0) //Function 1
{
S1=X; S2=Y; S3=Z;
}
Triangle(Triangle &T) //Function 2
{
T.S1 += 15;
S1 = T.S1;
S2 = T.S2;
T.S2 += 20;
S3 = T.S3;
}
void Show() //Function 3
{
cout<<S1<<"#"<<S2<<"#"<<S3<<endl;
}
};

void main()
{
___________ //Statement 1
___________ //Statement 2
___________ //Statement 3
}

(i) Write Statement 1 to declare an object T1 of class Triangle,


initialised by values 10 for S1, 20 for S2 and and 0 for S3.
(ii) Write Statement 2 which would invoke Function 2.
(iii) Write Statement 3 which would invoke Function 3 for the
object T1 declared in Statement 1.
.491/D 5 P.T.O.
(iv) Write the output of the above code after execution of all the
three statements, Statement 1, Statement 2 and
Statement 3 in the main().
OR

Write any two differences between a constructor and a destructor


function declared inside a class. Illustrate with the help of a
suitable example. 2

(c) Write the definition of a class CARGO in C++ with the following
description : 4

Private Members
 Distance // integer
 Weight // integer
 Charge // float
 GetCharge()
Member function to assign value of Charge based
upon Distance and Weight as follows :

Distance(Km) Weight(Grams) Charge(<)

<=100 <=500 150

>100 and <=500 >500 and <=999 300

Public Members
 Enter()

/* The function should allow a user to enter values


of Distance and Weight to assign the value of
Charge. It must then invoke the GetCharge() to
assign value of Charge */

 Display() // Function to display all the data members

.491/D 6
(d) Answer the questions (i) to (iv) based on the following : 4
class Book
{
char Bno[20];
protected:
float Price;
public:
void GetB();
void ShowB();
};

class Member
{
char Mno[20];
protected:
char Name[20];
public:
void GetM();
void ShowM();
};

class Library : public Member, private Book


{
char Lname[20];
public:
void GetL();
void ShowL();
};

void main()
{
Library L;
}

(i) Which type of Inheritance out of the following is illustrated


in the above example ?
 Single Level Inheritance, Multilevel Inheritance,
Multiple Inheritance
(ii) Write the names of all the data members, which are
directly accessible by the member function GetL() of class
Library.
.491/D 7 P.T.O.
(iii) Write the names of all the member functions, which are
directly accessible by the member function ShowL() of class
Library.

(iv) Write the names of all the members, which are directly
accessible by the object L of class Library declared in the
main() function.
OR
Consider the following class College, assuming all required header
files being included :
class College
{
char Cname[20];
protected :
float Fees;
public:
void ShowCollege();
};

Write a code in C++ to privately derive another class Faculty from


the base class College with the following members : 4
Data Members
 Total_seats of type int
 FName of type char array of size 20
Member Functions
 A constructor function to assign Total_seats as 500.
 GetFac() to allow user to enter FName and assign Fees (of
the base class College) its value depending upon entered
FName as follows :
FName Fees
Science 35000
Commerce 25000

 ShowFac() to display all the data members which are


accessible to it.

.491/D 8
3. (a) Write the definition of a function Mean(int A[], int N) in C++,
which should display the Mean (Average) of all the N number
of integers in the array A. 2
Example : If the array A contains following 5 elements (i.e. for N=5)

0 1 2 3 4
25 5 15 10 25

Then the function should display the output as follows :


Mean = 16
OR
Write the definition of a function ChangeConsonant(char Str[])
in C++, which should replace every occurrence of a consonant (non
vowel letters) with its previous letter (example, replace letter ‘b’ to
‘a’ and ‘B’ to ‘A’, ‘c’ to ‘b’ and ‘C’ to ‘B’, ‘d’ to ‘c’ and ‘D’ to ‘C’, ‘f’ to ‘e’
and ‘F’ to ‘E’ and so on...). The function should finally display the
charged content of the string. 2
Example : If the array Str contains the string : ‘‘Elephant’’
Then the function should rearrange the string to ‘‘Ekeogams’’
(b) Write the definition for a function SumAlter(int Arr[10][10], int N)
in C++, for a square matrix Arr having N rows and N columns, which
displays the sum of the elements of alternate rows starting from the
second row and the sum of the elements of the alternate columns
starting from the second column respectively. 3
For example : If array Arr for N=4, contains the following elements :
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

Then the function should display the following output :


Sum of alternate rows = 84
Sum of alternate columns = 72

OR

.491/D 9 P.T.O.
Write the definition for a function RevAlternate(char S[][20], int N)
in C++, which reverses the contents of the strings at every odd index of
the array of strings S. 3
For example : For an array S containing 6 strings (for N=6) as follows:
ORIGINAL ARRAY S CHANGED ARRAY S
First First
Second dnoceS
Third Third
Fourth htruoF
Fifth Fifth
Sixth htxiS

Note :
• DO NOT DISPLAY the Changed Array contents.
• Do not use any other array to transfer the contents of the array S.

(c) Let us assume Q[20][15] is a two-dimensional array, which is stored


in the memory along the row and each of its element occupies
4 bytes. Find the address of the element Q[15][5], if the address of
the element Q[5][10] is 25000. 3

OR
Let us assume N[30][25] is a two-dimensional array, which is stored
in the memory along the column and each of its elements occupies
4 bytes. Find the address of the element N[5][10], if the base address
of the array is 20000. 3

(d) Write the definition of a function Push(int P[], int &T), which
pushes an integer and Pop(int P[], int &T) which pops an
integer from the static stack of integers P, where the top of the stack
is represented by index T. The stack should be able to store a
maximum of 10 integers. The functions must also check for stack
overflow and stack underflow errors. 4
OR
.491/D 10
For the following structure of Book in C++
struct Book
{
int Bno;
Book *Link;
};
Given that the following declaration of class BookStack in C++
represents a dynamic stack of Buses :
class BookStack
{
Book *Top; //Pointer T to store address of the
//topmost Node of type Book
public:
BookStack()
{
Top = NULL;
}
void Push(); //Function to push a Book Node into the
//dynamic stack
void Pop(); //Function to pop a Book Node from the
//dynamic stack
~BookStack();
};
Write the definition for the member function
void BookStack::Pop(), that pops a Book Node from the
dynamic stack of BookStack. The function must also check for an
underflow error. 4

(e) Evaluate the following Postfix expression, showing the stack contents : 2
180,15,6,*,30,+,60,-,/
OR
Convert the following Infix expression to its equivalent Postfix
expression, showing the stack contents for each step of conversion : 2
P * Q / R - S ^ T

.491/D 11 P.T.O.
4. (a) A text file named SOLUTION.TXT contains some English sentences.
Another text file named TEST.TXT needs to be created such that it
replaces every occurrence of 3 consecutive letters ‘h’, ‘i’ and ‘s’
(irrespective of their cases) from each word of the file
SOLUTION.TXT, with 3 underscores (‘__’).
For example : If the file SOLUTION.TXT contains the following content :
"This is his history book."
Then TEST.TXT should contain the following :
"T____ is ____ ____tory book."
Write the definition for function CreateTest() in C++ that would
perform the above task of creating TEST.TXT from the already
existing file SOLUTION.TXT. 3
OR
A text file named AGENCIES.TXT contains some text. Write the
definition for a function Showsites() in C++ which displays all
such words of the file which have more than 9 characters and start
with "www.". For example : if the file AGENCIES.TXT contains : 3
"Name: TechnoCraft, Website: www.technocraft.com,
Name: DataTech, Website: www.datatech.com"
Then the function Showsites() should display the output as :
www.technocraft.com
www.datatech.com

(b) Write a definition for function Billing() in C++ to read each


record of a binary file STOCK.DAT, and display the Total Price of all
the records in the file. Assume that the file STOCK.DAT is created
with the help of objects of class Stock, which is defined below : 2

class Stock
{
char Name[20]; float Price;
public:
float RPrice() { return Price; }
};

OR
.491/D 12
A binary file ELECTION.DAT contains records stored as objects of the
following class :
class ELECTION
{
char Name[20]; int Count;
public:
int GetCount() { return Count; }
Char *RName() { return Name; }
};

Write the definition for function LowCount() in C++, which reads


every record from the file ELECTION.DAT and displays every such
Name whose Count is less than 100. 2

(c) Considering that binary file TRAINS.DAT contains 100 records of the
following class Train, find the output of the following C++ code : 1
class Train
{
int Tno; char FROM[20], To[20];
public:
void Get(); void Show();
};
void main()
{ fstream File;
File.open("TRAINS.DAT", ios::binary|ios::in);
Train T;
File.read((char*)&T,sizeof(T));
File.seekg(25*sizeof(T));
cout<<"Presently at "<< File.tellg()/sizeof(T)<< endl;
File.read((char*)&T,sizeof(T));
cout<<"Now at "<< File.tellg()/sizeof(T)<< endl;
File.close();
}

OR
Differentiate between seekg() and tellg(). 1

.491/D 13 P.T.O.
SECTION B
[Only for candidates, who opted for Python]
1. (a) Identify the valid keywords in Python from the following : 2
(i) Queue
(ii) False
(iii) in
(iv) Number
(v) global
(vi) method
(vii) import
(viii) List
(b) Name the Python Library modules which need to be imported to
invoke the following functions : 1
(i) floor()
(ii) random()
(c) Rewrite the following code in Python after removing all syntax
error(s). Underline each correction done in the code. 2
W = raw_input('Enter a word')
If W <> 'HELLO':
print W + 2
else
print W * 2
(d) Find and write the output of the following Python code : 2
def ChangeVal(M,N):
for i in range(N):
if M[i]%5 == 0:
M[i] //= 5
if M[i]%3 == 0:
M[i] //= 3
Val=[25,8,75,12]
ChangeVal(Val,4)
for N in Val:
print N,'#',

.491/D 14
(e) Find and write the output of the following Python code : 3
def Assign(P=30,Q=40):
P=P+Q
Q=P–Q
print P,'@',Q
return P
A=100
B=150
A=Assign(A,B)
print A,'@',B
B=Assign(B)
print A,'@',B

(f) What possible output(s) are expected to be displayed on screen at


the time of execution of the program from the following code ? Also,
specify the minimum and maximum values that can be assigned to
the variable End. 2

import random

Rainbow = ["VIOLET","INDIGO","BLUE","GREEN",
"YELLOW","ORANGE","RED"]

End = randrange(2)+3
Begin = randrange(End)+1
for i in range (Begin,End):
print Rainbow[i],"&",

(i) INDIGO & BLUE & GREEN & (ii) VIOLET & INDIGO & BLUE &

(iii) BLUE & GREEN & YELLOW & (iv) GREEN & YELLOW & ORANGE &

2. (a) What is method/function overriding in Python. Write a Python code


to illustrate how to invoke a base class overridden method inside an
inherited class. 2

.491/D 15 P.T.O.
(b) Write the output of the given Python code : 2
class Volume(object):
Length=10
Breadth=20
Height=5
def __init__(self,X=20, Y=30, Z=10):
self.Length = X
self.Breadth = Y
self.Height = Z
def ShowVol(self):
print self.Length*self.Breadth*self.Height
print Volume.Length*Volume.Breadth*Volume.Height
V1=Volume(15,30,10)
V1.ShowVol()
Volume.Height = 20
V2=Volume(30,40)
V2.ShowVol()

OR

class Triangle(object):
def __init__(self,N1=3, N2=4, N3=5): # Function 1
self.Side1 = N1
self.Side2 = N2
self.Side3 = N3
def ShowSides(self): # Function 2
print self.Side1, self.Side2, self.Side3
def __del__(self): # Function 3
print "Nothing to show"
def Workit(): # Function 4
___________ # Statement 1
___________ # Statement 2
Workit()

(i) Write the missing Statement 1 which will invoke the Function
1 for an object T of the class Triangle with values for Side1 as
10, Side2 as 15 and Side3 as 20, and the missing Statement 2
which will invoke the Function 2 for the object T.
(ii) Write the output for the above Python code after the missing
Statement 1 and Statement 2 are correctly written. 2
.491/D 16
(c) Write the definition of a class CARGO in Python with following
description : 4

Instance Attributes

 Distance

 Weight
 Charge

Methods/Functions

 GetCharge()
# to assign value of Charge based upon Distance and
# Weight as follows :

Distance(Km) Weight(Grams) Charge(<)

<=100 <=500 150

>100 and <=500 >500 and <=999 300

 Enter() # The function should allow a user to

# enter values of Distance and Weight

# to assign the value of Charge

# It must then call the GetCharge()to

# assign value of Charge

 Display() # Function to display Distance, Weight

# and Charge

.491/D 17 P.T.O.
(d) Answer the questions (i) to (iii) based on the following :
class Book(object):
def __init__(self,B_No,B_Price):
self.Bno = B_No
self.Price = B_Price
def GetB(self,B_No,B_Price):
self.Bno = B_No
self.Price = B_Price
def ShowB(self):
print self.Bno, self.Price,
class Member(object):
def __init__(self,M_Num,M_Name):
self.Mno=M_Num
self.Mname=M_Name
def GetM(self,M_Num,M_Name):
self.Mno=M_Num
self.Mname=M_Name
def ShowM(self):
print self.Mno, self.MName
class Library(Book,Member):
def __init__(self,L_Name,B,P,M,N): #Function 1
self.Lname=L_Name
Book.__init__(self,B,P)
Member.__init__(self,M,N)
def GetL(self,L_Name,B,P,M,N): #Function 2
self.Lname=L_Name
Book.GetB(self,B,P)
Member.GetM(self,M,N)
def ShowL(self):
Print self.Lname
Book.ShowB(self)
Member.ShowM(self)
L=Library('First',101,150,901,'Roshni')
L.ShowL()
L.GetL('Second',102,200,902,'Simran')
L.ShowL()
.491/D 18
(i) Write the type of the inheritance illustrated in the above
Python code. 1

(ii) Write the output of the above code. 2

(iii) What is the difference between Function 1 and Function 2,


although their definitions are the same. 1
OR
Consider the following class Shape in Python :
class Company(object):
CName=""
Area=0
def __init__(self,N):
Company.CName=N
Company.Area=20
def ShowCompany(self):
print self.CName,self.Area

Write a code in Python derive another class Department from the


class Company with the following :
 Attribute DName initialised with an empty string

 Attribute DArea initialised with 0

Class methods/functions

 A constructor function which should first invoke the class


Company’s constructor passing Company name (for CName) as
parameter.

 GetDept() to allow user to enter DName and DArea and then


add the entered value of DArea (of the class Department) to the
attribute Area (of the class Company).

 ShowDept() which should display the CName, Area of class


Company followed by DName and DArea of class Department. 4

.491/D 19 P.T.O.
3. (a) Consider the following randomly ordered numbers stored in a list :
325, 215, 74, 465, 520, 132, 97
Show the content of list after the First, Third and Fourth pass of
the Bubble sort method used for arranging in ascending order. 3
Note : Show the status of all the elements after each pass very
clearly encircling the changes.
OR
Consider the following randomly ordered numbers stored in a list :
325, 215, 74, 465, 520, 132, 97
Show the content of the list after the Second, Third and
Fourth pass of the Insertion sort method used for arranging in
descending order. 3
Note : Show the status of all the elements after each pass very
clearly encircling the changes.
(b) Write the definition of a function AddPrev(A, N) in Python, which
should add every previous value of list A to the next value and
assign the sum at the index of the next value. The list A contains N
number of integers. The function should finally display the entire
content of the changed list. 3
Example : If the list A contains the following 10 elements (i.e. for
N=10).
0 1 2 3 4 5 6 7 8 9
9 5 15 10 25 12 5 9 5 12
Then the function should display the output as follows :
9 # 14 # 29 # 39 # 64 # 76 # 81 # 90 # 95 # 107 #
OR
Write the definition of a function ChangeEvenOdd(Num, N) in
Python, which should add 1 to every even number and subtract 1
from every odd number. The function should finally display the
changed content of the list Num. 3
Example : If the list Num contains the following 10 elements
(i.e. for N=10)
0 1 2 3 4 5 6 7 8 9
25 12 5 10 9 5 15 9 5 12

Then the function should display the output as follows :


24 13 4 11 8 4 14 8 4 13
.491/D 20
(c) Write functions in Python for PushS(List) and for PopS(List) for
performing Push and Pop operations with a stack of List containing
integers. The function must check for Empty Stack. 4
OR
Write functions in Python for InsertQ(Names) and
RemoveQ(Names) for performing insertion and removal operations
with a queue of list which contains names of students. The function
must check for Empty Queue. 4
(d) Write a Python method/function SwapParts(Word) to swap the
first part and the second part of the string Word. Assuming there
are an even number of letters in the string Word. The function
should finally display the changed Word. 2
For example : If Word = 'Elephant’ then the function should
convert Word to 'hantElep' and display the output as:
Changed Word is hantElep
OR
Write a Python method/function Noun2Adj(Word) which checks if
the string Word ends with the letter ‘y’. If so, it replaces the last
letter ‘y’ with the string ‘iful’ and then displays the changed Word.
For example if the Word is "Beauty", then the Word should be
changed to "Beautiful". 2
Otherwise it should display
Not ending with "y"

(e) Evaluate the following Postfix expression, showing the stack


contents : 2
180,15,6,*,30,+,60,-,/
OR
Convert the following Infix expression to its equivalent Postfix
expression, showing the stack contents for each step of
conversion : 2
P * Q / R - S ^ T

4. (a) What is a NameError in Python ? 1


OR
What is a TypeError in Python ? 1
.491/D 21 P.T.O.
(b) A text file named SOLUTION.TXT contains some English sentences.
Another text file named TEST.TXT needs to be created such that it
replaces every occurence of 3 consecutive letters ‘h’, ‘i’ and ‘s’
(irrespective of their cases) from each word of the file
SOLUTION.TXT, with 3 underscores (‘___’).
For example : If the file SOLUTION.TXT contains the following
content :
"This is his history book."
Then TEST.TXT should contain the following :
"T ___ is ___ ___tory book."
Write the definition for function CreateTest()in Python that
would perform the above task of creating TEST.TXT from the
already existing file SOLUTION.TXT. 3
OR
A text file named AGENCIES.TXT contains some text. Write the
definition for a function Showsites() in Python which displays all
such words of the file which have more than 9 characters and start
with "www.".
For example : If the file AGENCIES.TXT contains :
"Name: TechnoCraft, Website: www.technocraft.com,
Name: DataTech, Website: www.datatech.com" 3
Then the function Showsites() should display the output as :
www.technocraft.com
www.datatech.com
(c) Write a definition for function Billing() in Python to read each
record of a pickled file STOCK.DAT, and display the Total Price of
all the records in the file. Assume that the file STOCK.DAT, is
created with the help of objects of class Stock, which is defined
below : 2
class Stock(object):
def __init__(self,N='',P=0):
self.SName=N
self.Price=P
OR
A pickled file ELECTION.DAT contains records stored as objects of
the following class :
class Election(object):
def __init__(self,N,C):
self.Name=N
self.Count=C
Write the definition for function LowCount()in Python, which
reads every record from ELECTION.DAT and displays every such
Name whose Count is less than 10. 2
.491/D 22
SECTION C
[For all candidates]

5. (a) Observe the following tables EMPLOYEES and DEPARTMENT


carefully and answer the questions that follow : 2
TABLE : EMPLOYEES TABLE : DEPARTMENT
ENO ENAME DOJ DNO DNO DNAME
E1 NUSRAT 2001-11-21 D3 D1 ACCOUNTS
E2 KABIR 2005-10-25 D1 D2 HR
D3 ADMIN

(i) What is the Degree of the table EMPLOYEES ? What is the


cardinality of the table DEPARTMENT ?
(ii) Write the result of a Cartesian Product operation performed
upon the tables EMPLOYEES and DEPARTMENT upon the
common attribute DNO from both tables.

(b) Write SQL queries for (i) to (iv) and write outputs for SQL queries
for (v) to (viii), which are based on the following two tables,
CUSTOMERS and PURCHASES : 6
Table : CUSTOMERS Table : PURCHASES
CNO CNAME CITIES SNO QTY PUR_DATE CNO
C1 SANYAM DELHI S1 15 2018-12-25 C2
C2 SHRUTI DELHI S2 10 2018-11-10 C1
C3 MEHER MUMBAI S3 12 2018-11-10 C4
C4 SAKSHI CHENNAI S4 7 2019-01-12 C7
C5 RITESH INDORE S5 11 2019-02-12 C2
C6 RAHUL DELHI S6 10 2018-10-12 C6
C7 AMEER CHENNAI S7 5 2019-05-09 C8
C8 MINAKSHI BANGALORE S8 20 2019-05-09 C3
C9 ANSHUL MUMBAI S9 8 2018-05-09 C9
S10 15 2018-11-12 C5
S11 6 2018-08-04 C7

.491/D 23 P.T.O.
(i) To display details of all CUSTOMERS whose CITIES are
neither Delhi nor Mumbai.
(ii) To display the CNAME and CITIES of all CUSTOMERS in
ascending order of their CNAME.
(iii) To display the number of CUSTOMERS along with their
respective CITIES in each of the CITIES.
(iv) To display details of all PURCHASES made (PUR_DATE) in
the year 2019.
(v) SELECT COUNT(DISTINCT CITIES) FROM CUSTOMERS;
(vi) SELECT MAX(PUR_DATE) FROM PURCHASES WHERE
QTY <10;
(vii) SELECT CITIES FROM CUSTOMERS
GROUP BY CITIES HAVING COUNT(*) = 2;
(viii) SELECT CNAME, QTY, PUR_DATE FROM CUSTOMERS,
PURCHASES WHERE CUSTOMERS.CNO = PURCHASES.CNO
AND QTY IN (10,20);

6. (a) State any one of the Absorption Laws of Boolean Algebra and verify
it using truth table. 2

(b) Draw the Logic Circuit of the following Boolean Expression : 2


A . B + B . C

(c) Derive a Canonical SOP expression for a Boolean function F,


represented by the following truth table : 1
X Y Z F(X,Y,Z)
0 0 0 1
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1

.491/D 24
(d) Reduce the following Boolean Expression to its simplest form using
K-Map : 3
F(A,B,C,D) = (5,6,7,10,11,13,14,15)

7. (a) A CEO of a car manufacturing company ElectroCars Ltd. located at


Mumbai wants to have an annual meeting with his counterparts
located at Delhi and Chennai where he would like to show as well as
see and discuss the presentations prepared at the three locations for
the financial year. Which communication technology out of the
following is best suited for taking such an online demonstration ? 1
(i) Chat
(ii) Teleconferencing
(iii) Video Conferencing

(b) Match the Telecommunication Technologies listed in the first


column of the following table with their corresponding features
listed in the second column of the table : 2

Technology Feature
 IP-based Protocols (LTE)
1G
 True Mobile Broadband
 Improved Data Services with Multimedia
2G
 Mobile Broadband
 Basic Voice Services
3G
 Analog-based Protocol
 Better Voice Services
4G  Basic Data Services
 First Digital Standards (GSM, CDMA)

(c) Write the names of one client side and one server side scripting
language. 1

.491/D 25 P.T.O.
(d) Write the expanded names for the following abbreviated terms used
in Networking and Communications : 2
(i) PPP
(ii) PAN
(iii) FTP
(iv) WLL

(e) Helping Hands is an NGO with its head office at Mumbai and
branches located at Delhi, Kolkata and Chennai. Their Head Office
located at Delhi needs a communication network to be established
between the head office and all the branch offices. The NGO has
received grant approval from the Central Government for setting up
the network. The physical distances between the branch offices and
the head office and the number of computers to be installed in each
of these branch offices and the head office are given below. As a
network expert you have to suggest the best possible solutions for
the queries as raised by the NGO, as given in (i) to (iv).

Distances between various locations in Kilometres :

Mumbai H.O. to Delhi 1420


Mumbai H.O. to Kolkata 1640
Mumbai H.O. to Chennai 2710
Delhi to Kolkata 1430
Delhi to Chennai 1870
Chennai to Kolkata 1750

Number of Computers installed at various locations are as follows :

Mumbai H.O. 2500


Delhi Branch 1200
Kolkata Branch 1300
Chennai Branch 1100

.491/D 26
(i) Suggest the drawing the best cable layout for effective
network connectivity of all the Branches and the Head Office
for communicating data. 1
(ii) Suggest the most suitable location to install the main server
of this NGO to communicate data with all the offices. 1
(iii) Write the name of the type of network out of the following,
which will be formed by connecting all the computer systems
across the network : 1
(A) WAN
(B) MAN
(C) LAN
(D) PAN
(iv) Suggest the most suitable medium for connecting the
computers installed across the network out of the following : 1
(A) Optical fibre
(B) Telephone wires
(C) Radio Waves
(D) Ethernet cable

.491/D 27 P.T.O.

You might also like