Sunteți pe pagina 1din 24

KANHA MAKHAN PUBLIC SCHOOL VRINDAVAN

Important Questions Class XII (2013-14)


Subject: - Computer Science
-------------------------------------------------------------------------------------------------------------
Chapter 1:- Revision of C++
Category A:- Short Answer Question ( 2 Marks in CBSE Board)

1. What is the difference between Run Type error and Syntax error? Give one example of each.
2. When will you make function inline and why?
3. What do you mean by free store with reference to memory allocation in c++?
4. What is the meaning of * * x? Give an example for alias in pointers .
5. Why does an array always start with an index 0 in C++?
6. What is the difference between get ( ) and getline ( ) functions.
7. What are actual arguments and formal arguments in C++? Explain with example
8. Differentiate between call by reference and call by value, with example?
9. What is the difference between Global Variable and Local Variable? Also, give a suitable C++ code to
illustrate both.
10. What is difference between Actual parameter and Formal parameter? Give an example in C++ to
illustrate both type of parameters.
11. Illustrate the use of #define in C++ to define a macro.
12. What do you mean by a reference of a variable in C++? Explain how is it created with suitable
example?
13. Write two major differences between procedural programming and object oriented programming.
14. What is the difference between implicit data casting and explicit data casting?
15. What is cascading in C++? Define with e.g.
16. What is the difference between while and do while loop?
17. What is alias or reference variable? Define with e.g.
18. What is scope resolution operator? Define with e.g.
19. What is shorthand notation? Define with e.g.
20. When will you make function inline and why?
21. How array is differ from structure?
22. What is nested structure? How data is accessed in nested structure?
23. Distinguish between object and class.
24. Reusability is one of the major properties of OOPS. How it is implemented in C++?
25. Why main function is special? Give two reasons.
26. Write two advantages of using include compiler directive?
27. What is the effect of absence of break statement in switch-case?
28. Name the header files associated with following functions
i). frexp() ii) toupper() iii) getc() iv) strcat () v) setw()
vi) exp() vii) isdigit() viii) puts() ix) scanf() x) getchar()
xi) clrscr() xii) gets() xiii) isalnum() xiv) fabs() xv) slrlen()
xvi) random() xvii) gotoxy()
29. Which C++ header file(s) will be essentially required to be included to run /execute the following C++
code:
void main()
{
char Msg[ ]="Sunset Gardens";
for (int I=5;I<strlen(Msg);I++)
puts(Msg);
}
30. Name the header files, to which following built-in functions belongs:
(i) isalnum() (ii) exit() (iii) ceil() (iv) fabs()
31. What do you mean by free store with reference to memory allocation in c++?

Category B:- Output and Error Questions ( 2 and 3 Marks in CBSE Board)

1. void PACK(char *str)

{ char ch='A';
int L,M,N;
for(L=0;L<str[L]!='\0';L++);
for(M=0;M<=L;M++)
if(str[M]=='-')
{ for(N=M;N<=L;N++)
str[N]=str[N+1];
}
else
if(isdigit(str[M])) str[M]=ch++;
}
void main( )
{ char STD[ ]="The-STD-code--is-0542";
PACK(STD);
cout<<STD<<endl;
getch();

}
2. int Pos=3;

int *Return_Ans(int *a,int &b)


{
if(b>=5)
{ *a+=b;
b-=2; }
else
{ (*a)--;}
return a;
}
void main( )
{ int P=8,Q=11,i;
for(i=1;i<=::Pos;i++)
{ int *Ans=Return_Ans(&P,Q);
cout<<*Ans<<','<<Q<<endl;
}
}

3. #include<iostream.h>
#include<stdlib.h>
#include<conio.h>
void main()
{ randomize( );
int A[]={4,5,6,7,8,9,10,11};
int N=5;
int num=random(A[N]);
for(int i=num;i>=1;i--)
{ cout<<i;
if(i!=1)
cout<<','; }
}
4. #include<iostream.h>
void main()
{ int Numbers[] = {2,4,8,10};
int *ptr = Numbers;
5. for (int C = 0; C<=3; C++)
{
cout<< *ptr << “@”;
ptr++;
}
cout<<endl;
ptr=Numbers;
for(C = 0; C<4; C++)
{
(*ptr)*=2;
++ptr;
}
for(C = 0; C<4; C++)
cout<< Numbers [C]<< “#”;
cout<<endl;
}

6). #include<iostream.h>
void Indirect(int Temp=20)
{
for (int 1=10; I<=Temp; I+=5)
cout<<I<<” , “ ;
cout<<endl;
}
void Direct (int &Num)
{
Num+=10;
Indirect(Num);
}
void main()
{
int Number=20;
Direct(Number) ;
Indirect();
cout<< “ Number=” <<Number<<endl ;
}
7). #include<iostream.h>
int a=10;
void main()
{
void demo(int &,int,int*);
int a=20,b=5;
demo(::a,a,&b);
cout<<::a<<a<<b<<endl;
}
void demo(int &x,int y,int *z)
{
a+=x;
y*=a;
*z=a+y;
cout<<x<<y<<*z<<endl;
}
8). # include<iostream.h>
#include<ctype.h>
#include<conio.h>
#include<string.h>
void NewText(char str[ ], int & pos)
{
char * p = str;
int length = strlen(p);
for( ; pos < length - 2; pos += 2 , p++)
{
*(p + pos) = toupper(*(p+pos)-1);
}
cout<<str;
}
void main( )
{
clrscr( );
NewText(“Good Morning”, 0) ;
}
9). //program RANDNUM.CPP
#include<iostream.h>
#include<stdlib.h>
#include<time.h>
void main()
{
randomize();
int VAL, Rnd; int n=1;
cin>>VAL;
Rnd=8 + random(VAL) * 1;
while(n<=Rnd)
{
cout<<n<< “\t”;
n++;
}
}
output options:
i) 1 2 3 4 5 6 7 8 9 10 11 12 13
ii) 0 1 2 3
iii) 1 2 3 4 5
iv) 1 2 3 4 5 6 7 8

10).
#include<iostream.h>
void main()
{
int *queen, Moves[ ] = { 11, 22, 33, 44 };
Queen = Moves;
Moves[2] + = 22;
cout<<”Queen @”<<*Queen<<endl;
*Queen - =11;
Queen + = 2;
cout<<”Now @”<<*Queen<<endl;
Queen++;
cout<<”Finally @”<<*Queen<<endl;
cout<<”New Origin @”<<Moves[0]<<endl;
}
11). Find the output of the following program;
#include<iostream.h>
#include<ctype.h>
void main( )
{
char TEXT1[ ] = “December@TEST!”;
for(int I=0; TEXT1 [I]!=’\0’;I++)
{
if(!isalpha(TEXT1[I]))
TEXT1[I]=’*’;
else if(isupper(TEXT1 [I]))
TEXT1[I]=TEXT1[I]+1;
else TEXT1[I] = TEXT1[I+1];
}
cout<<TEXT1;
}

12). Find out the errors in the following program. Underline each correction if any.

#include [iostream.h]
class MEMBER
{
static int C;
int Mno =0; float Fees;
PUBLIC:
void MEMBER (int i, float j;) { Mno=i; float Fees = j; }
void Register() { cin>>Mno>>Fees; C++;}
void Display { cout<<Mno<<" : "<<Fees<<endl<<”Total”<<C; }
};
void main()
{ MEMBER M;
Register();
M.Display();
}

13). Find the output for the following program:

#include<iostream.h>
#include<ctype.h>
void Encript ( char T[ ])
{
for( int i=0 ; T[i] != ‘ \0’ ; i += 2)
if( T[i] = = ‘A’ || T[i] = = ‘E’ )
T[i] = ‘#’ ;
else if (islower (T[i] ))
T[i] = toupper(T[i]);
else
T[i] = ‘@’;
}
void main()
{
char text [ ] = “SaVE EArTh in 2012”;
encrypt(text);
cout<<text<<endl;
}

14). Write the minimum and maximum output possible from the following code, if 7 is entered in N:

void main( )
{
int N, Guessme;
randomize( );
cin>>N;
Guessme=random(N)+10;
cout<<Guessme<<endl;
}

15). Find the output of the following program:

#include<iostream.h>
void main( )
{
int A=5,B=10;
for(int x=1;x<=2;x++)
{
cout<<++A<<”\t”<<B-- <<endl;
cout<<--B<<”\t”<<A++<<endl;
}
}

16). What will be the output of the following code fragment .Explain.

void main( )
{
clrscr( );
int x[ ] = {10,20,30,40,50};
int *p, **q, *t;
p = x;
t= x + 1;
q = &t;
cout<<*p<<’\t’<<**q<<’\t’<<*t++;
}
17). Name the header files that shall be needed for the successfully execution of following code:
void main()
{
char Word[]=”Exam”;
cout<<setw(20)<<Word;
}
18). In the following program, find the correct possible output(s) from the options:
#include<stdlib.h>
#include<iostream.h>
void main( )
{
randomize( );
char Area[ ][10]={“Physics”,”Computer”,”Maths”,”Hindi”};
int A;
for(int I=0; I<3;I++)
{
A=random(2) + 1;
cout<<Area[A]<<”:”;
}

19). Rewrite the following program after removing syntactical error(s) if any. Underline each correction.

#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();
}
20). Give the output of the following program segment (Assuming all required header files are included
in the program):
void main()
{
char *NAME=”a ProFiLe!”;
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;
}
21). Find the output of the following program.
#include<iostream.h>
void Withdef(int HisNum=30)
{
for(int I=20;I<=HisNum;I+=5)
cout<<I<<”,”;
cout<<endl;
}
void Control(int &MyNum)
{
MyNum+=10;
Withdef(MyNum);
}
void main()
{
int YourNum=20;
Control(YourNum);
Withdef();
cout<<”Number=”<<YourNum<<endl;
}
22). In the following program, find the correct possible output(s) from the options. Justify your answer.

#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-@@@

CHAPTER 2:- OBJECT ORIENTED PROGRAMMING


1. What do you understand by function overloading? Give an e.g.
2. What is constructor overloading? Which concept of oops used in it?
3. What is abstraction? Give an example for its implementations.
4. What is friend function? Why it is required?
5. What is the difference between private and protected visibility mode in a class?
6. How classes protect its data from external world?
7. What is data encapsulation? Give e.g.
8. What do you mean by concrete class?
9. What is abstract class and concrete class?
10. What is polymorphism? Give example in C++.
11. What are multiple definition of single function name, what makes them significantly different?
12. What is inheritance? Give suitable e.g.

CHAPTER 3:- CLASS AND OBJECTS


1. What is member function? How it is differ from ordinary function?
2. What is inline function? When you will make a function inline and why?
3. What is class? How it accomplish data hiding?
4. What do you mean by nested class? Give e.g.
5. What is containership in reference to class? Give e.g.
6. What is container class?
7. How an object is related to class?
8. What is nested class? Give e.g.
9. What is static data or static function?
10. What are friend functions? Why they are used?
11. Define a class Competition in C++ with the following descriptions:

Private Members:
Event_no integer
Description char(30)
Score integer
Qualified char
Award(int) To award qualified as ‘Y’, if score is more than the cut off score passed as
argument to the function else ‘N’.
Public Members:
A constructor to assign initial values Event_No as 101, Description as “State level”, Score is 50 and
Qualified as ‘N’ through parameters.
Input(), To take the input for Event_no, Description and Score and call the function Award().
Show(), To display all the details.

12. Define a class Stock in C+ + with the following description:


Private Members
 ICode of type integer (Item Code)
 Item of type string (Item Name)
 Price of type float(Price of each item)
 Qty of type integer (quantity in stock)
 Discount of type float (Discount percentage on the item)
 A member function FindDisc( ) to calculate discount as per the following rule:
If Qty<=50 Discount is 0
If Qty (51 and100) Discount is 5
If Qty>100 Discount is 10

Public Members:
 A constructor to assign all values with 0 and null respectively
 A function Buy( ) to allow user to enter values for ICode, Item, Price, Qty and call function
FindDisc( ) to calculate the discount.
A Function ShowAll( ) to allow userto view the content of all the data members.

13. Define a class in C++ with following description:


Private Members
A data member Flight number of type integer
A data member Destination of type string
A data member Distance of type float
A data member Fuel of type float
A member function CALFUEL() to calculate the value of Fuel as per the following criteria
Distance Fuel
<=1000 500
more than 1000 and <=2000 1100
more than 2000 2200
Public Members
A function FEEDINFO() to allow user to enter values for Flight Number, Destination, Distance & call
function CALFUEL() to calculate the quantity of Fuel
A function SHOWINFO() to allow user to view the content of all the data members

14. Define a class Telephone in C++ with following description:


Private Members
Name 20 character
Address 50 character
Teleno 8 digit phone number
PreviousMR Previous Meter Reading
PresentMR Present Meter Reading
Amount float
A member function CALBILL() to calculate and return the amount payable assuming the price of a
telephone call is Rs 0.50
Public Members
1. A function to provide initial value 0 to PreviousMR and PresentMR .
2. A function READINFO() to allow user to enter values the data members and call function
CALBILL() to calculate the total amount .
3. A function SHOWINFO() to view the content of all the data members

15. Define a class ELECTION with the following specifications . Write a suitable main ( ) function also to
declare 3 objects of ELECTION type and find the winner and display the details .
Private members :
Data : candidate_name , party , vote_received
Public members :
Functions :
1. enterdetails ( ) – to input data
2. Display ( ) – to display the details of the winner
3. Winner ( ) – To return the details of the winner through the object after comparing the votes
received by three candidates.

CHAPTER 4:- CONSTRUCTOR AND DESTRUCTOR


1. Why a destructor function required in a class? Illustrate with e.g.
2. What is the difference between constructor & destructor? Support your answer with example.
3. Answer the questions (i) and (ii) after going through the following class :

class TEST
{ private:
char subj[30];
int no_of_cand,roomno;
public:
TEST(char *,int,int); //constructor 1
TEST(TEST &T); // constructor 2
};
i) Write a statement that will invoke constructor 1.
ii) Write complete definition of constructor 2.
4. How does invoking of constructor differ in inheritance and containership? Give example
5. What is constructor? What is its need? Explain with the help of e.g.
6. Answer the following questions (i to ii) after going through the following class:

class Inter
{
int m;
public:
Inter( int Y ) { m = y; } // Function 1
Inter ( Inter & t ); // Function 2
~Inter() { } // Function 3
};

a) Create an object, such that it invokes Function 1.


b) What is Function 3?
c) Write complete definition for Function 2.
7. Differentiate between a default and a parameterized constructor in context of class and object. Give
suitable example in C++.
8. What do you understand by Copy constructor? Specify two instances when copy constructor is
invoked?
9. Differentiate between a constructor and destructor function.
10. Distinguish between the following two statements:
time T1(13, 10, 25); //statement 1
time T1 = time(13,10,25); //statement 2
11. What is copy constructor? Give an e.g.
12. What is constructor overloading? Illustrate with an e.g.
13. Write the parameterized constructor definition for the both classes given below:

class alpha
{
int a
float b;
char c;
public:
----------- //constructor definition
…... };
class beta : public alpha
{ int x;
public:
……………..//constructor definition

};
14. What is default constructor? How it is different from other member function?
15. Answer the questions (i) and (ii) after going through the following class:

class WORK
{
int WorkID;
char WorkType;
public:
~WORK( ) // Function 1
{
cout<<”Un-Allocated”<<endl;
}
void status( ) // Function 2
{
cout<<WorkID<<”;”<<WorkType<<endl;
}
WORK( ) // Function 3
{
WorkID=10;
WorkType=’T’;
}
WORK(WORK &W) // Function 4
{
WorkID=W.WorkID+12;
WorkType=W.WorkType+1;
}
};

(i) Which member function out of function1, function2, function3 and function4 shown in the above
example of class WORK is called automatically, when the scope of an object gets over? Is it known
as Constructor OR Destructor OR Overloaded Function OR Copy Constructor?
(ii) WORK W; //Statement 1
WORK Y (W); //Statement 2

(iii) Which member function out of Function1, Function2, Function3 and Function4 shown in above
definition of class WORK will be called on execution of statement written as Statement 2? What is
this function specifically known as out of Destructor or Copy Constructor or Parameterized
Constructor?
16. Consider the following and answer the questions given below:

class CEO
{
double Turnover;
protected:
int Noofcomp;
public:
CEO();
void INPUT(int);
void OUTPUT();
};
class Director : public CEO
{
int Noofemp;
public:
Director ();
void Indata();
void Outdata();
protected:
float Funds;
};
class Manager : public Director
{
float Expenses;
public:
void Display();
Manager();
}

a) Which constructor will be called first at the time of declaration of an object of class Manager?
b) How many bytes will an object belonging to class Manager require?
c) Name the member function(s), which are directly accessible from the object of class Manager.
d) Is the data member Funds accessible by the object of the class Manager and why?
e) If the class Manager is derived in protected mode in place of public then, give the names of
inherited members in the protected section only?

CHAPTER 5:- INHERITANCE


1. What do you understand by a base class and derived class? Give e.g.
2. What do you mean by visibility modes in class inheritance? What are these modes?
3. Define the types of inheritance used in C++.
4. Does C++ support multiple inheritance? Give e.g. if yes.
5. What is super class and sub class?
6. Answer the questions (i)to (iv) based on the following:
class FacetoFace
{
char CenterCode[10];
public:
void Input( );
void Output( );
};
class Online
{
char Website[50];
public:
void Sitein( );
void Siteout( );};
class Training : public FacetoFace, private Online
{
long Tcode;
float Charge;
int Period;
public:
void Register( );
void Show ( ); };

(i) Which type of inheritance is shown in the above example?


(ii) Write names of all member functions accessible from Show( ) function of class Training.
(iii) Write names of all the members accessible through an object of class Training.
(iv) Is the function Output( ) accessible inside the function SiteOut( )? Justify you answer.
7. Answer the questions (i) to (iv) based on the following:
class Regular
{
char School Code [10];
public :
void InRegular(); void outRegular(); };
class Distance
{
char StudyCentreCode[5];
public :
void Indistance ( );
void OutDistance ( ); };
class Course: public Regular, private Distance
{
char Code[5];
float Fees ; int Duration;
public:
void InCourse ();
void Out Course ();
};
(i) Which type of Inheritance is shown in the above example ?
(ii) Write names of all the member functions accessible from OutCourse function of class Course.
(iii) Write name of all the members accessible through an object of class Course.
(v) Is the function InRegular() accessible inside the function InDistance() ? Justify your answer.

CHAPTER 6:- DATA FILE HANDLING

1. Differentiate between ifstream class ofstream class.


2. How seekg() is different from seekp()?
3. Define the file opening modes in C++.
4. How tellg() is different from tell()?
5. Define file pointers with e.g.
6. What is the difference between text file and binary file?
7. How get() is different from getline()?
8. Differentiate between read() and write() function.
9. Differentiate between getline() and getc() function.
10. What is the difference between serial file and sequential file?
11. Distinguish between ios::out and ios::app.
12. What is the difference between write() and put() functions.
13. Write the header files associated with the data file handling.
14. Distinguish between ios::ate and ios::app.
15. Distinguish between serial and sequential file in C++.
16. What is the difference between get() and read() function?
17. Write a user defined function in C++ to read the content of a text file STORY.TXT, count and display
the number of alphabets present in it.
18. Write a user defined function in C++ to read the content of a text file STORY.TXT, count and display
the number of spaces present in it.
19. Write a user defined function in C++ to read the content of a text file STORY.TXT, count and display
the number of words present in it.
20. Class Vehicle
{
int no_of_wheel;
char vehicleType[10];
public:
void getdata();
void displaydata();
}

Assuming the above shown file write a function showfile( ) to read all the records present in already
Existing binary file “SPEED.DAT” and display them on screen, also count the number of records
Present in the file.

21. Assuming the class Employee given below, write function in C++ to perform the following
a. Write the objects of Employee to the binary file.
b. Read the objects from the binary file and display them on the screen.
Class Employee
{
int ENO;
char Ename[20];
public:
void getit();
void showit();
}
22. Write a program to display the size of a file in bytes.

CHAPTER 7 : ARRAY
1. Differentiate between data type and data structure.
2. What is meant by base address in the array?
3. How is computer memory allotted for a two – dimensional array?
4. An array A [-2...5] [-4...1] is stored in the memory with each element occupying 4 bytes of space.
Assuming the address of A [0] [-1] is 1000 then compute the base address of A and also the address of
A [4] [1], when the array is stored as row wise.
5. An array T[15][10] is stored in the memory with each element requiring 2 bytes of storage. If the base
address of T is 2000, determine the location of T[7][8] when it is stored by
a. Row wise b. column wise
6. The array A[20][10] is stored in the memory with each element requiring one byte of storage if the
base address of A is C0. Determine C0 when the location of A[10][15] is 2000.
7. Write a function to add elements of rows in a matrix.
8. Write a function to transpose a matrix.
9. Write a function to add two matrix in c++.
10. Write a function to add elements of diagonals of matrix.
11. Use inserting sort for sorting following series in ascending order
12, 9, 4, 11, 15, 18
12. Use bubble sort for sorting following series in ascending order
42, 29, 74, 11, 65, 58
13. Each element of an array D[1……10][1…….10] requires 8 bytes of storage. If the base address of array
of D is 2000, determine the location of D[4][5] , when the array is stored as
a) Row wise b) column wise
14. Write a program to search a number in array by using binary search.
15. Write a function in C++ which accepts an array of integer type and its size as arguments and rearrange
the array in following order.
For example:
If array contents: 1, 3, 5, 7, 9 ,11, 13, 15, 17, 19
Array after rearrangement: 11, 13, 15, 17, 19, 1, 3, 5, 7, 9
16. An array T[50][20] is stored in the memory along the column with each element occupying 4 bytes.
Find out the base address and address of element T[30[15], if an element T[25][10] is stored at the
memory location 9800.
17. Write a function SORTSCORE() in C++ to sort an array of structure Examinee in descending order of
Score using Bubble Sort

CHAPTER 8:- LINK LIST , STACK AND QUEUE

1. Differentiate between LIFO and FIFO list.


2. Why a stack is called LIFO data structure?
3. What is stack? How it is differ from queue?
4. What is circular queue? Define its types.
5. Evaluate the postfix notation by showing the status of stack
500, 20, 30, +, 10, *, +
6. Evaluate the postfix notation by showing the status of stack
120, 45, 20, +, 25, 15, -, +, *
7. Evaluate the postfix notation by showing the status of stack
20, 45, +, 20, 10, - , 15, +, *
8. Convert into postfix notation by showing the stack status
A * B + ( C – D/F)
9. Convert into postfix notation by showing the stack status
(A + B) * C + D / E – F
10. Write a user defined function to display the sum of row elements of two dimensional array A[5][6]
containing integer.
11. Write a user defined function to pop a number from given stack.
struct stack
{
int info;
stack *next;
};
12. Write a user defined function to push a number in given stack.
struct stack
{
int info;
char name[15];
stack *next;
};
13. Write a user defined function to insert a number in given queue.
struct queue
{
int info;
queue *next;
};
14. Write a user defined function to delete a number in given queue.
struct queue
{
int info;
char name[15];
queue *next;
};
15. Evaluate the postfix notation by showing the status of stack
TRUE, FALSE, TRUE, FALSE, NOT, OR, TRUE, OR, OR, AND
16. Write a function in C++ to delete an element from a dynamically allocated Queue where each node
contains a real number as data.
Assume the following definition of MYNODE for the same.
struct MYNODE
{
float NUM;
MYNODE *Link;
};

17. Convert the following infix expression to its equivalent postfix expression Showing stack contents for
the conversion:
(A+B)*(C^(D-E)+F)-G
18. Evaluate the following postfix notation of expression:
(Show status of stack after each operation)

True, False, NOT, OR, False, True, OR, AND


CHAPTER 9:- DATABASE CONCEPT

1. What is primary key in a table?


2. What are DDL and DML? Give the SQL commands for each.
3. Differentiate between Tuple and Attribute.
4. What is relation? What is RDBMS?
5. What is degree and cardinality in a relation?
6. What is candidate key? Give an e.g. of primary table by making a relation.
7. What is primary key? Give an e.g. of primary table by making a relation.
8. What is alternate key? Give an e.g. of primary table by making a relation.
9. What is foreign key? Give an e.g. of primary table by making a relation.
10. Define selection operator used in relational algebra with e.g.
11. Define projection operator used in relational algebra with e.g.
12. What are DDL and DML Commands? Give one example of each

CHAPTER 10:- STRUCTURED QUERRY LANGUAGE

1. Differentiate between Data definition language and Data Manipulation language.


2. What are DDL and DML?
3. Define the functions used in SQL.
4. How count() is differ from count(*)?
5. What is the use of alter command? Define with e.g.
6. What is the difference between table and view?
7. What is the difference between table constraint and column constraint?
8. What is check constraint? How it is used?
9. Differentiate DROP TABLE and DROP VIEW commands in SQL.
10. Define all constraints used in SQL.
11. What is the difference between WHERE and HAVING clause in SQL?
12. Consider the following tables Stationary and Consumer. Write SQL commands for the statement (i) to
(iv) and output for SQL queries (v) to (viii):
Table: Stationary

S_ID StationaryName Company Price


DP01 Dot Pen ABC 10
PL02 Pencil XYZ 6
ER05 Eraser XYZ 7
PL01 Pencil CAM 5
GP02 Gel Pen ABC 15

Table: Consumer

C_ID ConsumerName Address S_ID


01 Good Learner Delhi PL01
06 Write Well Mumbai GP02
12 Topper Delhi DP01
15 Write & Draw Delhi PL02
16 Motivation Banglore PL01

(i) To display the details of those consumers whose Address is Delhi.


(ii) To display the details of Stationary whose Price is in the range of 8 to 15. (Both Value included)
(iii) To display the ConsumerName, Address from Table Consumer, and Company and Price from table
Stationary, with their corresponding matching S_ID.
(iv) To increase the Price of all stationary by 2.
(v) SELECT DISTINCT Address FROM Consumer;
(vi) SELECT Company, MAX(Price), MIN(Price), COUNT(*) from Stationary GROUP BY Company;
(vii) SELECT Consumer.ConsumerName, Stationary.StationaryName, Stationary.Price FROM Strionary,
Consumer WHERE Consumer.S_ID=Stationary.S_ID;
(viii) Select StationaryName, Price*3 From Stationary;

13. Consider the following WORKERS and DESIG. Write SQL commands for the statements (i) to (iv) and
give outputs for SQL queries (v) to (vi)

WORKERS

W_I FIRSTNAME LASTNAME ADDRESS CITY


102
D Sam Tones 33 Elm St. Paris
105 Sarah Ackerman 440 U.S. 110 New York
144 Manila Sengupta 24 Friends Street New Delhi
210 George Smith 83 First Street Howard
255 Mary Jones 842 Vine Ave. Losantiville
300 Robert Samuel 9 Fifth Cross Washingto
335 Henry Williams 12Moore Street Boston
n
403 Ronny Lee 121 Harrison St. New York
451 Pat Thompson 11 Red Road Paris

DESIG

W_ID SALARY BENEFITS DESIGNATIO


102 75000 15000 Manager
N
105 85000 25000 Director
144 70000 15000 Manager
210 75000 12500 Manager
255 50000 12000 Clerk
300 45000 10000 Clerk
335 40000 10000 Clerk
403 32000 7500 Salesman
451 28000 7500 Salesman

(i) To display the content of workers table in ascending order of first name.
(ii) To display the FIRSTNAME, CITY and TOTAL SALARY of all Clerks from the tables workers and design,
where TOTAL SALARY = SALARY + BENEFITS.
(iii) To display the minimum SALARY among Managers and Clerks from the table DESIG.
(iv) Increase the BENEFITS of all Salesmen by 10% in table DESIG.
(v) SELECT FIRSTNAME, SALARY FROM WORKERS, DESIG WHERE DESIGNATION = ‘Manager’
AND WORKERS.W_ID = DESIG.W_ID;
(vi) SELECT DESIGNATION, SUM(SALARY) FROM DESIG
GROUP BY DESIGNATION HAVING COUNT(*)>=2 ;

CHAPTER 11:- BOOLEAN ALGEBRA


1. Verify the following algebraically
a. (A’+B’).(A+B)=A’.B+A.B’

2. Draw a logical Circuit Diagram for the following Boolean Expression: A.(B+C’)
3. Write the equivalent Canonical Sum of Product for the following Product of Sum
Expression: F(X,Y,Z)= (1,3,6,7)
4. If F(a,b,c,d) =(0,1,3,4,5,7,8,9,11,12,13,15), obtain the simplified form using K-Map.
5. State and verify De-Morgan’s Theorem in Boolean algebra, algebraically. 2
6. Reduce the following Boolean expression using K-map:
F(A,B,C,D)=(0,1,2,4,5,8,9,10,11) 3
7. Convert the following into SOP form: 2
(P+Q+R) (P’+Q+R) (P’+Q’+R) (P+Q+R’).

8. State and verify the Absorption Law in Boolean Algebra.

9. Draw the logic circuit diagram for the Boolean equation: (A+B’)(A’+B+C’)(A’+C’) (

10. Write the Sum of Product form of the function H (U, V, W). Truth table representation of the function
H is as follows:

U V W H
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1

11. Minimize the following function using K- map and find out the expression

F(A, B, C, D) = ∑ (0, 2, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15)

CHAPTER 12:- NETWORKING

1. What was the role of ARPANET in the Computer Network?


2. Which of the following units measures the speed with which data can be transmitted from one node
to another node of a network? Also, give the expansion of the suggested unit.
a. (i) KMph (ii) Mbps (iii) MGps
3. Write the full forms of the following: (i) FTP (ii) FSF
4. “Vidya for All” is an educational NGO. It is setting up its new campus at Jaipur for its web based
activities. The campus has four buildings as shown in diagram below:

Main Resource
Building Building

Accounts
Training
Building
Building

5. Center to center distances between various buildings as per architectural drawings (in m) is as follows:

Main Building to Resource Building 120m

Main Building to Training Building 40m

Main Building to Accounts Building 135m

Resource Building to Training Building 125m

Resource Building to Accounts Building 45m

Training Building to Accounts Building 110m

Expected number of Computers in each building is as follows:

Main Building 15

Resource Building 25

Training Building 250

Accounts Building 10

a. Suggest a cable layout of connection between the buildings.


b. Suggest the most suitable place( i.e building) to house the server of this NGO. Also provide a
suitable reason for your suggestion.
c. Suggest the placement of the following devices with justification:
i. Repeater
ii. Hub/Switch
d. The NGO is planning to connect its International office situated in Delhi. Which out of following
wired communication links, will you suggest for very high speed connectivity?
e. i) Telephone Analog Line ii) Optical Fibre iii) Ethernet Cable
6. What are cookies?
7. What do you mean by FLOSS?
8. Differentiate between LAN & WAN?
9. Write a brief note on types of cables used in communication.
10. Define the following terms: a). HTTP b). DHTML
11. Differentiate between open source and free software? Give examples.

“Kanganalay Cosmetics” is planning to start their offices in four major cities in Uttar Pradesh to provide
cosmetic product support in its retail fields. The company has planned to set up their offices in Lucknow
at three different locations and have named them as “Head office”, “Sales office”, & “Prod office”. The
company’s regional offices are located at Varanasi, Kanpur & Saharanpur. A rough layout of the same is as
follows :

Approximate distances between these offices as per network survey team is as follows :

Place from Place to Distance Head office 156


Head office Sales office 150M Sales office 25
Head office Prod office 80M Prod office 56
Head office Varanasi Office 295 KM Varanasi Office 85
Head office Kanpur Office 195 KM Kanpur Office 107
Head office Saharanpur 408 KM Saharanpur office 105
Number of computers:
office
i) Suggest the placement of the Server with justification in Lucknow city network.
ii) Suggest the placement of repeaters and switches for the Lucknow city network.
iii) If we connect all offices in UP in a network, then which type of this network is called? Also suggest a
suitable way to connect them in most economical way.

S-ar putea să vă placă și