47
QUESTION BANK HIGHER ORDER THINKING SKILLS CLASS XII – COMPUTER SCIENCE 1 Mark Questi!s Pr"ra##i!" i! C$$ 1. Observe the program segment carefully and answer the question that follows: class item { int item_no; char item_name[!";  public: void enter#etail$ %; void show#etail$ %; int get&tem_no$ %{ return item_no;' '; void modify$item () int y % { fstream *ile; *ile.open$ +item.dat, ) ios::binary - ios::in - ios::out% ; item i; int recordsead / !) found / !; while$0found *ile.read$$ch ar2% i ) si3eof $i%%% { recordsead44; if$i . get&tem_no$ % / / y % {  ________ _______55 6issing statement *ile.write$$ch ar2% ( ) si3eof $(%%; found / 1; ' ' if$0 found% cout77,eco rd for modificati on does not e(ist, ; *ile.close$% ; ' &f the function modify$ % is supposed to modify a record in the file + item.dat +) which item_no is y) with the values of item ( passed as argument) write the appropriate statement for the missing statement using see8p$ % or see8g$ %) whichever is needed) in the above code that would write the modified record at its proper place. . Observe the program segment carefully and answer the question that follows: class member { int member_no; char member_nam e[!";  public: void enter#etail$ %; void show#etail$ %; int get6ember_no$ %{ return member_no;' '; void update$member 9 % { fstream *ile; 1 | Page Question Bank - Computer Science | Ms. Chandni Agarwal

Question Bank Xii

Embed Size (px)

DESCRIPTION

XII

Citation preview

Page 1: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 1/47

QUESTION BANK 

HIGHER ORDER THINKING SKILLS

CLASS XII – COMPUTER SCIENCE

1 Mark Questi!s

Pr"ra##i!" i! C$$1. Observe the program segment carefully and answer the question that follows:class item

{

int item_no;char item_name[!"; public:

void enter#etail$ %;void show#etail$ %;

int get&tem_no$ %{ return item_no;'';

void modify$item () int y %

{

fstream *ile;*ile.open$ +item.dat,) ios::binary - ios::in - ios::out% ;

item i;int recordsead / !) found / !;

while$0found *ile.read$$char2% i ) si3eof $i%%%{

recordsead44;if$i . get&tem_no$ % / / y %

{ _________________________556issing statement

*ile.write$$char2% ( ) si3eof $(%%;found / 1;

'

'

if$0 found%cout77,ecord for modification does not e(ist, ;

*ile.close$% ;'

&f the function modify$ % is supposed to modify a record in the file + item.dat +) whichitem_no is y) with the values of item ( passed as argument) write the appropriate

statement for the missing statement using see8p$ % or see8g$ %) whichever is needed) inthe above code that would write the modified record at its proper place.

. Observe the program segment carefully and answer the question that follows:class member 

{

int member_no;char member_name[!";

 public:

void enter#etail$ %;void show#etail$ %;

int get6ember_no$ %{ return member_no;'';

void update$member 9 %{

fstream *ile;

1 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 2: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 2/47

*ile.open$ +member.dat,) ios::binary-ios::in-ios::out% ;member i;

while$*ile .read$$char2% i ) si3eof $i%%%{

if$9 . get6ember_no$ % / / i . get6ember_no$ %%

{

 _________________________556issing statement*ile.write$$char2% 9 ) si3eof $9%%;

''

*ile.close$% ;

'

&f the function update$ % is supposed to modify the member_name field of a record inthe file + member.dat, with the values of member 9 passed as argument) write the

appropriate statement for the missing statement using see8p$ % or see8g$ %) whichever isneeded) in the above code that would write the modified record at its proper place.

<. Observe the program segment carefully and answer the question that follows:class item

{ int item_no;

char item_name[!";

 public:void enter#etails$ %;

void show#etail$ %;int get&tem_no$ %{ return item_no;' ';

void modify$item ( %

{

fstream *ile;*ile.open$ +item.dat,) _______________ % ; 55parameter missing

item i;while$*ile .read$$char2% i ) si3eof $i%%%

{ if$( . get&tem_no$ % / / i . get&tem_no$ %%{ *ile.see8p$*ile.tellg$ % = si3eof$i%%;

*ile.write$$char2% ( ) si3eof $(%%; '

else

*ile.write$$char2% i ) si3eof $i%%; '*ile.close$% ;

'&f the function modify$ % modifies a record in the file + item.dat + with the values of 

item ( passed as argument) write the appropriate parameter for the missing parameter in

the above code) so as to modify record at its proper place.

>. Observe the program segment carefully and answer the question that follows:class member 

{

int member_no;char member_name[!"; public:

void enter#etails$ %;

void show#etail$ %;

int get6ember_no$ %{ return member_no;'';

void update$member 9 %{ fstream *ile;

*ile.open$ +member.dat,) ios::binary-ios::in-ios::out% ;

2 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 3: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 3/47

member i;while$*ile .read$$char2% i ) si3eof $i%%%

{ if$9 . get6ember_no$ % / / i . get6ember_no$ %%{

*ile.see8p$ _________ ) ios::cur % 55?aremeter 6issing

*ile.write$$char2% 9 ) si3eof $9%%;

' ' *ile.close$% ; '&f the function update$ % is supposed to modify a record in the file + member.dat, with

the values of member 9 passed as argument) write the appropriate parameter for themissing parameter in the above code) so as to modify record at its proper place.

@. A file named as +BCD#9C.#AC, contains the student records) i.e. obEects of class student.

rite the command to open the file to update a student record. $Dse suitable stream class and

file mode$s%.

F. A file named as +BCD#9C.#AC, contains the student records) i.e. obEects of class student.

Assuming that the file is Eust opened through the obEect *&G of fstream class) in the required

file mode) write the command to position the put pointer to point to second record from the last

record.

H. A file named as +BCD#9C.#AC, contains the student records) i.e. obEects of class student.

Assuming that the file is Eust opened through the obEect *&G of fstream class) in the required

file mode) write the command to position the get pointer to point to fifth record from the

 beginning.

I. ead the code given below and answer the question:void main$ %

{

char ch / JAK;

fstream out*ile $+data.dat,) ios::out%;

out*ile77ch77ch;

'

&f the file contains LOO# before e(ecution) what will be the contents of the file after e(ecution

of this codeM

N. Observe the program segment carefully and answer the question that follows:

class student

{

int student_no;char student_name[!";

int mar8;

 public:

void enter#etail$ %;

void show#etail$ %;

void change_mar8$ %; 55*unction to change the mar8 

int getBtudent_no$ %{ return student_no;'

';

void modify$ int y %

{

fstream *ile;

*ile.open$ +student.dat,) ios::binary-ios::in-ios::out% ;

student i;int recordsead / !) found / !;

while$0found *ile .read$$char2% i ) si3eof $i%%%

{

recordsead44;

if$i . getBtudent_no$ % / / y %

{

i . change_mar8$ %;

 _________________________556issing statement 1

 _________________________556issing statement

 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 4: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 4/47

found / 1; ' '

if$ found / / 1%

cout77,ecord modified, ;

*ile.close$% ; '

&f the function modify$ % is supposed to change the mar8 of a student having student_no y in

the file +student.dat,) write the missing statements to modify the student record.

1!. Observe the program segment carefully and answer the question that follows:

class item

{

int item_no;char item_name[!";

 public:

void enter#etail$ %;

void show#etail$ %;

int get&tem_no$ %{ return item_no;'

';

void modify$item ( %

{ fstream *ile;

*ile.open$ +item.dat,) ios::binary-ios::in-ios::out % ;

item i;

while$*ile .read$$char2% i ) si3eof $i%%%55Btatement 1

{ if$( . get&tem_no$ % / / i . get&tem_no$ %%

{ *ile.see8p$*ile.tellg$ % = si3eof$i%%;*ile.write$$char2% ( ) si3eof $(%%;

' '

*ile.close$% ;

'

&f the function modify$ % modifies a record in the file + item.dat, with the values of item (

 passed as argument) rewrite statement 1 in the above code using ios::eof$ % ) so as to modify

record at its proper place.

% Marks Questi!s Pr"ra##i!" i! C$$1. hat is wrong with the following while loop:

a. int counter / 1; b. int counter / 1;

while $ counter 7 1!!% while $ counter 7 1!!%

{ cout 77 counter 77 +n;cout 77 counter 77 +n; counter 4 4;

counter P P;

'

. hat will be the output of following:

void main $ %

{

int val / 1!;

cout 77 val 44 77 val 77 44 val;

'

<. Liven the following code fragment:

int ch / !;

cout 77 ch 77 44 ch 77 ch 77 +n,;

$i% Che output of the code fragment.$ii% hat is the effect of replacing 44 ch with ch 4 1M

>. #ifferentiate between the output of following code fragments:

$i% int f / 1) i / ; $ii% int f / 1) i / ;

while $44 i 7 @% do {

f 2/ i; f 2/ i;

cout 77 f; ' while $44 i 7 @%;

cout 77 f;

@. Live output:

Qinclude7iostream.hR

! | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 5: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 5/47

int global / !;

void fun $int () int y%

{

( / ( = y; y / ( 2 1!;

cout 77 ( 77 J) K 77 y 77 JnK;

'

void main$%

{

int global / I;

fun $&& global) global%;

cout 77 global 77 J) K 77 && global 77 JnK;

fun $global) && global%;

cout 77 global 77 J) K 77 && global 77 JnK;

'

F. Live output:

Qinclude7iostream.hR

int fun $ int a) int b / !%

{

if $a S b / / !% return 44 a;

else return b P P ;

'

void main$%

{int ( / !) y / <;

y / fun $() y%;

cout 77 ( 77 J) K 77 y 77 JnK;

( / fun $y%;

cout 77 ( 77 J) K 77 y 77 JnK;

y / fun $(%;

cout 77 ( 77 J) K 77 y 77 JnK; '

H. *ind output

Qinclude7iostream.hR

void fun $int A) int T%

{ A / A 4 T;

T / A = T;

A / A = T; '

void main $ %

{

int a / >) b / 1I;

fun $a) b%;

cout 77 a 77 +) , 77 b; '

I. Live output:

void Uhange $int ([>". int i%

{ ([i" / ([i" 2 &; '

void main $ %

{ int ([ " / {11) 1) <1) >1';

for $int i / !; i 7 >; i44%

{ Uhange $() i%;cout 77 ([i" 77 JnK; ' '

N. ewrite the following codes after removing errors) if any) in the following snippet. (plain eacherror.

Qinclude7iostream.hR

void main$%

{ int ([@") 2y) 3[@"

for $i / !; i 7 @; i 44

{

([i" / i;

3[i" / i 4 <;

" | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 6: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 6/47

y / 3;

( / y;

' '

1!. ewrite the following codes after removing errors) if any) in the following snippet. (plain each error.

void main$%

{ const int i / !;

const int 2 const ptr / i;

$2ptr%44;

int E / 1@; ptr / E; '

11. Live the output of the following program:void main$%

{

char 2p / +#ifficult,;

char c;

c / 44 2p 44; printf $+Sc,)c%; '

1. Live the output of the following program:

void main$%

{

int ( [" / { 1!) !) <!) >!) @!':

int 2p) 22q) 2t;

 p / (; t / ( 4 1; q / t;

cout 77 2p 77 +), 77 22q 77 +), 77 2t44; '

1<. &n the following program) if the value of 9 given by the user is !) what ma(imum andminimum value the program could possibly display $%M

Qinclude7iostream.hR

Qinclude7stdlib.hR

void main$%

{ int 9) Luessme;

randomi3e$%; cinRR9;

Luessme / random$9P1!% 4 1! ; cout77Luessme77endl; '

1>. ewrite the following program after removing the error$s%) if any. Dnderline each correction.

Qinclude 7iostream.hR

void main$%

{

int () sum /!;cinRRn;

for $(/1;(71!!) (4/%

if (S/!

sum4/(;

cout77 +sum/, RRsum; '

1@. hat will be the output of the following programM

Qinclude 7iostream.hR

void main$%

{ int A[@" /{!) <) >) ) 1';

int b[@"/ {!'; int n />;

for $ int i/!; i7@;44i%

 b[a[i""/a[i";

cout77 b[!"77b[1"77b["77b[<'77b[>"; '1F. hat will be the output of the following program

Qinclude7iostream.hR

void main$%

{ int var1/@)var/1!;

for$int i/1;i7/;i44%

{ cout 77 var144 77 +t, 77 PPvar77 endl;

cout 77 varPP 77 +t, 77 44var177 endl; ' '

1H. *ind the output of the following program

Qinclude7iostream.hR

# | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 7: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 7/47

void main$ %

{ long 9D6 / 1<>@><;

int * / !) B / !;

do

{ int em / 9D6S 1!;

if $em S 0/!%

*4 /;

else

B4 / ;

 9D65/1!;

' while$9D6R!%;

cout77*PB; '

1I. *ind the output of the following program:

Qinclude7iostream.hR

void main$%

{ long 9umber / H@I<>1;

int *irst/!) Becond/!;

do

{ int /9umberS1!;

if $S//!%

*irst4/;

else

Becond4/; 9umber 5/1!;

' while $9umber R !%;

cout77*irstPBecond; '

1N. ewrite the following program after removing the syntactical error$s%) if any Dnderline each

correction:

Qinclude 7iostream.hR

void main$ %

{ struct CV

{ char 6anu_name[!";

char Cv_Cype;

int ?rice / 1H!!!;

' 9ew Cv;

gets$6anu_name%; gets$Cv_Cype%; '

!. &dentify error in the following program segment:

class ATU{

 public:

int read$%;

char display val$%;

 private:

int (; char ch; '

1. rite the output of the following program:

Qinclude7iostream.hR

class Cest{

int a) b;

 public:void set$ int &) int E% { a / &; b / E;'

void show$% {cout 77 a 77 + , 77 b 77 endl;' ';

void main$%

{ Cest t1) t; C1.set$1!)>%; t / t1;

t1.show$% ; t.show$%; '

. Answer the questions after going through the following class

class (am

{ int year;

 public:

$ | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 8: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 8/47

(am$int y% {year/y;' 55Uonstructor 1

(am$(am t%; 55Uonstructor

';

i. Ureate an obEect) such that it invo8es Uonstructor &.

ii. rite complete definition for Uonstructor .

<. Answer the questions after going through the following class.

class (am

{ char BubEect[!" ;

int 6ar8s ;

 public :(am$% 55 *unction 1

{ strcpy$BubEect) +Uomputer, % ;

6ar8s / ! ; '

(am$char ?[ "% 55 *unction

{ strcpy$BubEect) ?% ;

  6ar8s/! ; '

(am$int 6% 55 *unction <

{ strcpy$BubEect) +Uomputer,% ; 6ar8s / 6 ; '

(am$char ?[ ") int 6% 55 *unction >

{ strcpy$BubEect) ?% ; 6ar8s / 6 ; ' ';a% hich feature of the ObEect Oriented ?rogramming is demonstrated using *unction 1)

*unction) *unction < and *unction > in the above class (amM

 b% rite statements in U44 that would e(ecute *unction < and *unction > of class (am.>. ewrite the following program after removing all the synta( error$s%) if any. Dnderline each correction.

Qinclude7iostream.hR

struct ?i(els

{ int Uolor) Btyle ; '

void Bhow?oint$?i(els ?%

{ cout77?.Uolor)?.Btyle77endl; '

void main$%

{ ?i(els ?oint1 / $@)<%; Bhow?oint$?oint 1%; ?i(els ?oint / ?oint1

Uolor.?oint14/;

Bhow?oint$?oint%; '

@. rite a function in U44 to count the number of uppercase alphabets present in a te(t file +BCOW.CXC,.

F. rite a function in U44 to count the number of lowercase alphabets present in a te(t file +BCOW.CXC,.H. rite a function in U44 to count the number of alphabets present in a te(t file +XW.CXC,.

I. rite a user defined function in U44 to read the content of a te(t file +YOZ.CXC,) count and display the number o

 blan8 spaces present in it.

N. rite a function in U44 to count and display the number of lines starting with alphabet JAK in a te(t file

+6W*&G.CXC,.

<!. rite a function in U44 to print the count of the word +and, in the te(t file +6yfile.t(t,.

<1. rite a function in U44 to write the characters entered through the 8eyboard into the file +myfile.t(t,) until a JQK

character is entered.

<. rite a function in U44 to count the number of words present in the te(t file +6y*ile.t(t,.Assume that each word i

separated by a blan8 space and no blan8 space appears in the beginning and at the end of the file.

<<. rite a function in U44 to count and display the number of student records stored in the binary file +Btudent)dat, .

Assume that student is a structure and 1! bytes of memory is required to store each student record.<>. ow many stream obEects would you need to manage the following situations:

$a% Co process three files sequentially.

$b% Co merge two sorted files into third file.

<@. Observe the program segment carefully and answer the question that follows:

class item

{

int item_no;

char item_name[!";

 public:

% | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 9: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 9/47

void enter#etail$ %; void show#etail$ %; int get&tem_no$ %{ return item_no;' ';

void modify$item ( %

{ fstream *ile;

*ile.open$ +item.dat,) ios::binary-ios::in-ios::out % ;

item i;

while$*ile .read$$char2% i ) si3eof $i%%%

{ if$( . get&tem_no$ % / / i . get&tem_no$ %%

{ *ile.see8p$*ile.tellg$ % = si3eof$i%%;

*ile.write$$char2% ( ) si3eof $(%%; ' '

*ile.close$ % ; 55Btatement 1

'

Che function modify$ % modifies a record in the file + item.dat + .Btate whether statement 1 is

mandatoryM Live e(planation.

<F. rite a function in U44 to calculate the average word si3e in the te(t file +6y*ile.t(t,.

<H. Liven the binary file BCD#9C.#AC ) containing the records of the following class:

class student

{

int roll_no; char name[!"; float percent;

 public:

void get#ata$ %; void show$ %;

float return?ercent$ %

{ return percent; ' ';

rite a function TGOH@$ % in U44 ) that would count and display the records of thosestudents whose score is below H@ percent.

<I. rite a function which ta8es pointers to two strings as parameter and compare thesestrings. Che function should return 1 if two strings are same otherwise return !.

<N. Live the output of the following program$ Assume all necessary header files are included% :void main$ %

{

char 2 ( / +teAm&ndia,;

char c; c / 44 2( 44; cout77c; '>!. Live the output of the following program$Assume all necessary header files are included%:

void main$ %{

char 2( / +teAm&ndia,;

char c; c / $ 2$(41% % 44 ; cout77c; '

>1. Live the output of the following program$ Assume all necessary header files are included%:void main$ %

{ char 2 ( / +teAm&ndia,; char c; c / 44$ 2$(41% %; cout77c; '>. hat will be the output of the program$ Assume all necessary header files are included% :

Qinclude7iostream.hRvoid print $char 2 p %

{ p / \pass\;

cout77\value is \77p77endl; '

void main$ %

{ char 2 ( / \Test of luc8\; print$(%;cout77\new value is \77(77endl; '

Data Stru'ture& Arra() Sta'k a!* QueueUonvert the following infi( e(pressions to postfi( e(pressions

1. $$$(2y =a2b%Pd5f%4a%2b

. $a4$$$bP$c2dPe%4f%%5g%%2$hPE%

<. A4T2$?4]%^U5#

>. A4TPU2#4*PL

& | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 10: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 10/47

@. A^TPA5$T2$APTPA2#%5T%

F. A4$$$TPU%2$#P%4*5L%^$PY%

H. $A4T% 2$U^$#P%4*PL

I. A2$T4$U4#%2$4*%5L%2

N. A2$T4U%5#PP$*4L5%

1!. A 4 T 2 U ^ # = $ 5 * = L%

11 A = T 4 U 2 # ^ 2 L 5

1 $$A4T%P$$U_#%25*%2L

1< $CD *AGB% -- 0 $*AGB -- CD%

1> $A 4 T 2 U % 5 # 4 5 $* 2 L 4 5 &%

1@ 9OC A O 9OC T A9# 9OC U

valuate the following postfi( e(pression given below) show the contents of the stac8 during

the evaluation

1F / 1!)2)1@)P)@)@)5)4

1H / H)F))^)2)1I)4

1I / 1!)>@)!)4)@)1@)P)4)2

1N CD *AGB CD *AGB 9OC O CD O A9#

! / <!)@))^)1)F)5)4)P

1 1@) <) ) 4) 5) H) 4 ) 2

@) I) <) P ) 5 F) 2) 1! 4

< AT = U# 4 2 4 A / @) T / <) U / @) # / > A9# / > H)F) 4) I) 2 ) ) P) <) 2 ) ) >) 2 ) P

@ I) H) 4) N) I) 4) P) ) 5 ) <)>) 2 ) 5 4

F / @)!)1@)P)2)@))2)4

B+ea! A+"e,ra1 #esign $A4T%.$U4#% using A9#PO Late.

6inimi3e *$A)T)U% / AKTU4ATKUK4ATKU4AT4AKTK using Zarnaugh 6ap

< 6inimi3e the > variable Toolean function

*$A)T)U)#%/ ATUK#4AKTU#4AKTKU4AKTK#K4AUK4AKTKU4TK

> #raw the circuit for the following function using 9A9# Late

*$A)T)U)#%/#$A4T$U4AK%4TK%

@ #esign $A4T%.$U4#% using 9O Late.

F Bimplify the following Toolean (pression using Toolean postulates and laws of Toolean Algebra.

$a% /(y3 4 (Ky4(y3K

$b% /$aK4a%.bK.c4a.bK.cK4a.b.$c4cK%

H Bimplify the following Toolean (pression using Toolean postulates and laws of Toolean Algebra.

X/ aK.bK.cK4aK.bK.c4a.bK.cK4a.bK.c

I Bimplify the following Toolean (pression using Toolean postulates and laws of Toolean Algebra.

* / $A4TK4U4#K%.$AK4TK4U4#%.$A4TK4U4#K%.$AK4TK4U4#K%.$AK4T4U4#K%

N ?rove (K.yK4y.3 / (.yK.3K4(K.yK.34(K.y.34(.y.3 algebraically.

1! A Toolean function * defined on three input variable X)W) is 1 if and only if the number of 1$One% input is odd $e.g

* is 1 if X/1)W/!)/!%. #raw the truth table for the above function and e(press it in canonical Bop form.

11 #raw the logic circuit diagram of the following e(pression using 9O Late only ? / $(K4yK43K%$(4yK43%$(4y43K%.

1 Uhec8 the validity of the following Toolean (pression:

$y43%$34(%/$(K4yK%$(K43K%$yK43K%

1< ?rove that $aK4bK%$aK4b%$a4bK%/aKbK.

1> Bimplify AT4$AU%K4ATKU$AT4U% algebraically.

15 Uonvert $A4T%$ATK4AU%$AKUK4TKUK% to BO? form.

1F Uonvert $A4T%$TK4U%$AK4U% to BO? *orm.

1H ?rove XW4W4WK/XW4 algebraically.

1I #raw the Cruth Cable for XO and X9O Late.

1N ?rove that 9A9# and 9O Late are universal gate.

1' | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 11: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 11/47

! (plain the elation ship between minterms and ma(terms. An (pression is given in BO? form *$()y)3%/B$!)1)>)@%

show its min terms and ma(terms.

1 epresent $AK4TK4UK%$A4TK4UK% in 9O to 9O logic networ8.

#raw the simplified logic diagram using only 9A9# gates to implement the three input

function f denoted by the e(pression $9ot Ty using Z 6ap% */ ∑$ !)1))@%

< (press ?4]K in canonical BO? *orm and ?OB *orm.

> (press the Toolean *unction *$()y)3% /(y4(K3 in a product of ma( term form.

@ rite the equivalent canonical Bum of ?roduct e(pression for the following ?roduct of Bum

(pression *$X)W)%/ π $1)<)F)H%

F A maEority gate is a digital circuit whose output is equal to 1 if the maEority of the inputs are 1.

Che output is ! otherwise. Ty means of a truth table) find the Toolean e(pression implemented

 by < input maEority gates.

H An even parity gate is a digital circuit whose output is equal to 1 if the odd numbers of inputs

are 1. Che output is ! otherwise. Ty means of a truth table

$a% *ind the Toolean function implemented by a < input odd parity gate.

$b% hich single gate can be used to represent this circuit

- Marks Questi!s Pr"ra##i!" i! C$$1 Live output of following code fragment:

int val) res) n / 1!!!;

cin RR val;

res / n 4 val R 1H@! M >!! : !!;cout 77 res;

$a% if the input is !!!.

$b% if the input is 1!!!.

$c% if the input is @!!.

hat will be the output if input is:

$i% a $ii% c $iii% d $iv% h $v% b

char ch) out [1!" / + ,; cin RR ch;

switch $ch% {case JaK: strcat$out) +a,%;

case JbK: strcat$out) +b,%;

case JcK: strcat$out) +c,%;

 brea8;

case JdK: strcat$out) +d,%;

 brea8;

default : strcat$out) +9ot abcd,%; '

cout 77 out 77 endl;

< Live output of following code fragment:

char 2msg / +a ?ro*ile,;for $int i / !; i 7 strlen $msg%; i44%

if $islower$msg[i"%%

msg[i" / toupper $msg[i"%;

else

if $isupper$msg[i"%%

if$ i S 0/ !%

msg[i" / tolower $msg[iP1"%;

else

msg[iPP";

cout 77 msg 77 endl;

@ *ind outputQinclude7iostream.hR

struct To( {

int Gen) Tre) ei;

';

void #imension$To( T%

{

cout 77 T.Gen 77 + X , 77 T.Tre 77 + X ,;

cout 77 T.ei 77 endl;

> Live output of following code fragment:

@char 2msg / +GUO6,;for $int i / strlen $msg% P 1; & R/ !; iPP%

if $islower$msg[i"%%

msg[i" / toupper $msg[i"%;

else

if $isupper$msg[i"%%

if$ i S 0/ !%

msg[i" / tolower $msg[iP1"%;

else

msg[iPP";

cout 77 msg 77 endl;

F Live outputint (ecute$ int 6%

{

if $6 S < / !%

return 6 2 <;

else

return 6 4 1!;

'

void output$ int T / %

11 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 12: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 12/47

'

void main $ %

{

To( T1 / {1!) !) I') T) T<;

44T1.ei;

#imension $T1%;

T</ T1;

44T<.Gen;

T<.Tre44;#imension $T<%;

T/ T<;

T.ei 4/ @;

T.Gen P / ;

P a g e | 21

#imension $T%;

'

{

for $int C / !; C 7 T; C44%

cout 77 (ecute$C% 77 +2,;

cout 77 endl;

'

void main$%

{

output $>%;

output $ %;output $<%;

'

H Live the output of the following program:

void main$%

{

int ar[" / {) <) >) @';int 2ptr / arr;

int val / 2ptr; cout 77 val 77 endl;

val / 2ptr 44; cout 77 val 77 endl;

val / 2ptr; cout 77 val 77 endl;

val / 2 44ptr; cout 77 val 77 endl;

'

I Live the output of the following program:

void main$%

{int ar[" / {) <) >) @';

int 2ptr / arr;

int val / 2ptr; cout 77 val 77 endl;

val / 2ptr 44; cout 77 val 77 endl;

val / 2ptr; cout 77 val 77 endl;

val / 2 44ptr; cout 77 val 77 endl;

'

N Live the output of the following program :

Qinclude7iostream.hR

struct point{ int ()y; ';

void showpoint p%

{ cout77p.(77 J:K77p.y77endl; '

void main$%

{ point u / {!)1!')V);

v/u; v.(4/!; w/v; u.y4/1!;

u.(4/@; w.(P/@; show$u%;

show$v%; show$w%; '

1!. rite the output of the following program :

Qinclude7iostream.hR

int calc$int u%{

if$uS//!%

return u41!;

else

return u2; '

void pattern$char 6) int T/%

{ for$int cnt/!;cnt7b;cnt44%

cout77calc$cnt%77m; cout77endl; '

void main$%

{ pattern$J2K%; pattern$JQK)>%; pattern$J`K)<%; '

11 *ind the output of the following program:

Qinclude7iostream.hR

Qinclude7conio.hR

void UhangeUontent$int Arr[") int Uount%

{ for$int U/1 ; U7Uount ; U44%

{ Arr[UP1"4/Arr[U" ; ' '

void main$%

{ clrscr$ %;

1 *ind the output of the following program:

Qinclude7iostream.hR

Qinclude7conio.hR

struct Lame

{ char 6agic[!";

int Bcore; ';

void main$%

{

12 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 13: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 13/47

int A[ "/{<) > ) @') T[ "/{1!)!)<!)>!') U[ "/{N!!) 1!!')

G ;

UhangeUontent$A)<%; UhangeUontent$T)>%;

UhangeUontent$U)%;

for$G/! ; G7< ; G44%

{ cout77A[G"77\Q\;

'

cout77endl;

for$G/! ; G7> ; G44%{ cout77T[G"77\Q\ ; '

cout77endl;

for$G/! ; G7 ; G44%

{ cout77U[G"77\Q\ ; '

getch$%; '

clrscr$%;

Lame 6/{\Ciger\) @!!' ;

char 2Uhoice ; Uhoice / 6.6agic; Uhoice[>"/? ;

Uhoice["/G ;

6.Bcore4/@!; cout776.6agic776.Bcore77endl;

Lame 9/ 6; 9.BcoreP/1! ;

cout779.6agic779.Bcore77endl;

getch$%;

'

1< rite the output of the following program:

Qinclude7iostream.hR

Qinclude7string.hR

Qinclude7ctype.hR

void convert $char str[") int len%{ for $int count /!; count 7len; count44%

{ if $ isupper$str[count"%%

str[count"/tolower$str[count"%;

else if $ islower$str[count"%%

str[count"/toupper$str[count"%;

else if $ isdigit$str[count"%%

str[count"/str[count"4;

else

str[count"/ JQK; ' '

void main$%

{ char te(t["/ +A&BBU !!I`,;int si3e /strlen$te(t%;

convert $te(t)si3e%;

cout77te(t77endl;

for $int c /!) r/si3eP1; c7/si3e5;c44) rPP%

{ char temp/ te(t[c";

te(t [c"/ te(t[r";

te(t[r"/ temp; '

cout77 te(t 77 endl; '

1> Live the output of the following program.

Qinclude 7 iostream.h R

Qinclude 7conio.h R

int a / 1!;

int main$ %{

void demo $ int ) int ) int 2%;

clrscr$ %;

int a / !;

demo $ ::a)a)b%;

cout 77 ::a 77 +t, 77 a 77 +t, 77 b;

'

void demo $ int () int y ) int 23 %

{

a 4/ (; y 2/ a; 23 / a4y;

cout 77 ( 77 +t, 77 y 77 +t, 77 23 77 endl;'

1@ rite the output of the follwoing program segment

char 29A6/\Uom?Dte\;

for$int (/!;(7strlen$9A6%;(44%if$islower$9A6[("%%

 9A6[("/toupper$9A6[("%;

else

if$isupper$9A6[("%%

if$(S//!%

 9A6[("/tolower$9A6[("%%;

else

1F hat will be the output of the following program

Qinclude7iostream.hR

Qinclude7ctype.hRQinclude7conio.hR

Qinclude7string.hR

void changestring$char te(t[") int counter%

{ char 2ptr / te(t; int length/strlen$te(t%;

for$;counter7lengthP;counter4/)ptr44%

{ 2$ptr4counter% / toupper$2$ptr4counter%%; ' '

void main$%

{ clrscr$%;

1 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 14: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 14/47

 9A6[X"/9A6[(P1";

 puts$9A6%;

int position / !; char message["/ +6ouse *un,;

changestring$6essage)position%; cout77message77 +`,

77position; '

1H hat will be the output of the following program:

Qinclude7iostream.hR

Qinclude7ctype.hR

Qinclude7conio.hR

Qinclude7string.hRvoid changestring$char te(t[") int counter%

{ char 2ptr / te(t; int length/strlen$te(t%;

for$ ;counter7lengthP; counter4/)ptr44%

{ 2$ptr4counter% / toupper$2$ptr4counter%%; ' '

void main$%

{ clrscr$%; int position / !;

char message["/ +?ointer *un,;

changestring$6essage) position%;

cout77message77 +`, 77position; '

1I. *ind the output of the following program

Q include7iostream.hR

Qinclude7string.hR

class state

{ char 2 state_name; int si3e; public;

state$ %; { si3e/!; state_name/new char[si3e41"; '

state$char 2s% { si3e / strlen$s% ; state_name / new

char[si3e41";'

strcpy$state_name) s%; '

void display$% {cout77state name77endl; '

void eplace $state a) state b%

{ si3e / a.si3e 4 b.si3e;

delete state_name;

state_name / new char[si3e41" ;

strcpy$state_name) a.state_name%;strcat$state_name) b.state_name%; ' ';

void main$ %

{ char 2temp / +#elhi,; state state1$temp%)

state$,6umbai,%) state<$,9agpur,%) B1) B;

B1.eplace$state1) state%; B.eplace$B1) state<%;

B1.display$ %; B.display$ %; '

1N ewrite the following program after removing the

syntactical error$s%) if any. Dnderline each

correction.

Qinclude 7iostream.hR

void main$ %{ struct movie

{ char movie_name [!";

char movie type;

int tic8et cost / 1!!;

'6OV&;

gets$movie_name%;

gets$movie_type%;

'

! *ind the output of the following program:

Qinclude7iostream.hR

Qinclude7string.hR

class student

{ char 2name; int & ; public:

student$ % {& /!; name/new char [ & 41"; '

student $char 2s%

{ & /strlen$s%; name/new char[&41";

strcpy $name)s%; '

void display$ % {cout77name77endl;'

void manipulate$student a) student b%

{ & / a.& 4 b.&;

delete name; name/new char[&41";

strcpy$name) a.name%; strcat$name) b.name%; ' ';

void main$ %{ char 2 temp / +Yac8,;

student name1 $temp%) name$, Yill,%)

name<$,Yohn,%)B1)B;

B1 .manipulate $name1) name%;

B.manipulate $B1) name<%; B1.display $ %; B.display $ %

'

1 *ind the output of the following program:

Qinclude7iostream.hR

*ind the output of the following program:

Qinclude 7 iostream.hR

1! | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 15: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 15/47

Qinclude7string.hR

class country

{ char 2country name; int length;

 public:.

country $ %

{length /!; country_name/new char [length41";'

country $char 2s%

{ length / strlen$s%; country_name/new char [length 41";

strcpy $country_name) s%; 'void display $ % { cout77 country_name 77endl;'

void eplace $country a) country b%

{ length a.length 4 b.length;

delete country_name;

country_name/new char [length 4 1";

strcpy $country_ name) a.country_name%;

strcat $country_name) b.country name%;

' ';

void main $ %

{ char 2 temp / +&ndia,;

country country1 $temp%) country $+9epal,%) country<$+Uhina,%) B1)B;

B1.eplace $country1) country%;

B.eplace $B1)country<%;

B1.display$ %; B.display $ %; '

void main$ %

{ int 2?ointerArray [1!";

int mar8s [ / {H@) FI) N!) <>) !) 1!) N!) F@';

for $int & / !; mar8s [ &"0/!; &44%

{ ?ointerArray [&"/mar8s[&";

2 $?ointerArray [&" % 4/ @;

'

int inde( / !;

while$inde( 7 & %{ int p/2$?ointerArray[inde(" %;

if$p R/F!% cout 77p77 J) K;

inde( 44;

'

'

< class boo8 

{ int boo8_no; char boo8_name[!"; float price;

 public:

void enter_boo8_#etails$ %

{ cinRR boo8_noRR price; gets$boo8_name%; '

void show_boo8_#etails$ %; ';

Assuming a binary file +TOOZ.#AC, contains obEects belonging to class boo8) write a user defined function to add more records to the end of it.

> Assuming a binary file +TOOZ.#AC, contains obEects belonging to class boo8) write a user 

defined function to add more records to the beginning of it.

@ Assuming a binary file +TOOZ.#AC, contains ten obEects belonging to class boo8) write a user 

defined function to add a record as fifth record to this file. After the e(ecution of your code) the

file +TOOZ.#AC, should contain eleven records

F A librarian maintains the record of boo8s in a file named as +BCOUZ_TOOZ.#AC,. rite a

function in U44 to delete a record for boo8_no 1!.

H Observe the program segment carefully and answer the question that follows:

class student

{ int student_no; char student_name[!"; int mar8;

 public:void enter#etails$ %

{ cinRR student_no RR mar8 ; gets$student_name%; '

void show#etail$ %;

int get_mar8$ %{ return mar8;' ';

Assuming a binary file +BDGC.#AC, contains records belonging to student class) write a

user defined function to separate the records having mar8 

$i% Lreater than HN into +XUGG9C.#AC, file

$ii% Lreater than @N but less than I! into +AVAL.#AC, file.

$iii% emaining records should be in +BDGC.#AC, file.

1" | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 16: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 16/47

I Liven the binary file CG?O9.#AC ) containing the records of the following class #irectory:

class #irectory

{ char name[!";

char address[<!"; char areaUode[@"; char phone_no[1@";

 public:

void register$ %; void show$ %;

int chec8Uode$ char AU[" %

{ return strcmp$areaUode) AU%; ' ';

rite a function UO?WATU$ % in U44 ) that would copy only those records having areaUode as +1<, from

CG?O9.#AC to CGTAUZ.#AC.N rite a function in U44 to add a new record into a binary file +customer.dat, ) if the file contains the obEects of the

following class:

class customer 

{ int cust_no; char name[!";

 public:

void get#ata$ %

{

cinRR cust_no; cin.getline$name) ! %; '

void show#ata$ %; 55 *unction to display customer details ';

<! Liven the binary file &C6.#AC) containing the records of the following structure:

struct item

{

int item_no; char item_name[!"; int stoc8; ';&mplement the function AddBtoc8$ item () int n%) which updates a record by adding n to the

e(isting stoc8 for the item ( in the file.

<1 rite definition for a function BD6B]D9U$% in U44 with two arguments5parameters = 

double ( and int n. Che function should return a value of type double and it should perform sum

of the following series :

1P(510 4 (5<0 P (<5@0 4 (>5H0 P (@5N 4 . Dp to n terms.

$9ote : Che symbol 0 represents *actorial of a number i.e. @0 / @2>2<221%

< rite a U44 function BD6*D9$% having parameters X $of type double% and n $of type integer%

with a result type as double to find the sum of the series given below :

X 4 X5<0 4 X<5@0 4 .4 Xn5$9P1%0

<< An array of a structure Btudent) B is required to be arranged in descending order of mar8s.

rite a U44 function to arrange the same with the help of bubble sort. Che array and its si3e isrequired to be passed as parameters to the function.

#efinition of structure student is as follows

struct Btudent

{ int rollno; char name[!"; float mar8s; ';

<> An array containing elements of structure mployee is required to be arranged in descending order of salary. rite

a U44 function to arrange the same with the help of Belection sort. Che array and its si3e is required to be passed as

 parameters to the functions. #efinitions of the structure is as follows

struct mployee

{ int empno; char name[!"; float salary; ';

<@ Live the output of the following program :

Qinclude7iostream.hR

Qinclude7conio.hRQinclude7string.hR

Qinclude7ctype.hR

void main$ %{

 int b; char bboy[1!"; clrscr$ %; bboy[!"/KdK)bboy[1"/KeK)bboy["/KfK)bboy[<"/KgK;

len$bboy%;

getch$ %; return !; '

void len$char boy[1!"%

1# | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 17: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 17/47

{ int l)v/!; l/strlen$boy%;for $int i/!;i7/l;i44%

{ if $$boy[i"//KaK%--$boy[i"//KeK%--$boy[i"//KiK%--$boy[i"//KoK -- $boy[i"//KuK%%v/v41; '

cout77l77v; return; '

<F. Live the output of the following program :

Qinclude7iostream.hRQinclude7conio.hR

main$ %{ int number[1!")a)b)c)d;

clrscr$ %;

for$int i/!;i71!;i44%

{ number[i"/i4i; 'clrscr$ %;

for$int E/!;E7N;E44%{ for$int 8/E41;871!;844% {

if $number[E"Rnumber[8"%{ a/number[E";

number[E"/number[8"; number[8"/a; ' ' '

cout77endl;

for$i/!;i71!;i44%cout77number[i"77+t,;i44; getch$ %; return !; '

<H Live the output of the following program :Qinclude7iostream.hR

Qinclude7conio.hR

main$ %

{ int a/!; clrscr$ %; char 2name; name/ +&nternet Trowsing,;for$a/!;a7/I;a44%

cout77name[a41"; cout77endl; cout77name[a";cout77endl77$int%name[a"P1; getch$ %; return !; '

<I Live the output of the following program :Qinclude7iostream.hR

Qinclude7conio.hR

main$ %

{void arm$int%; clrscr$ %; int num;

num/1N1;arm$num%;

getch$ %; return !; '

void arm$int n%

{ int number) sum/!)dg)dgg)digit;number/n;

while$nR!%

{ dg/n51!; dgg/dg21!; digit/nPdgg;cout77digit4digit77endl; sum/sum4digit2digit2digit;n/n51!; '

cout77digit77endl77sum; '

<N Live the output of the following program :

Qinclude7iostream.hRQinclude7conio.hR

Qinclude7string.hRmain$ %

{

1$ | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 18: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 18/47

clrscr$ %;char 2name;

int l;name/ +BA9A,;

l/strlen$name%;

cout77l77endl77$int% name[lP";

cout77endl;cout77name[lP<"; getch$ %;

return !; '>! Live the output of the following program :

Qinclude7iostream.hR

Qinclude7conio.hR

Qinclude7stdio.hRQinclude7string.hR

main$ %{

clrscr$ %; char 2name; int len/!;name/ +dheeraE`lw1.vsnl.net.in,;

len / strlen$name%;

len / lenP1; cout77endl;

for$int i/len;iR/!;i/iP%{ cout77name[i";'

cout77endl; cout77i; cout77endl; cout77name[i4>"; cout77endl; getch$ %; return !; '>1 Assuming the class mployee given below and a binary file 6?GOW.#AC contains

obEects of this class) write functions in U44 to perform the followings:

$i% rite an obEect at the end of the binary file.

$ii% Dpdate the salary of all the employees whose salary is 1!!!! with a new salary!!!!.

class mployee{int emp_no; char name[!"; float salary;

 public:void get#ata$ %

{ cinRR emp_noRRsalary; gets$name%; '

void setBalary$float f %

{ salary / f; 'float get_salary$ %

{ return salary; ' ';

> hat is the output of the following

 program$ Assume all necessary header files are

included% :

void main$ %

{ char 2name/ +&ntra9et,;

for $ int i / !; i 7 strlen$ name% ; i44%{ if $ islower$ name[i"% %

name[i" /toupper$name[i"% ;

else name[i" / name[i P 1" ; ' '

>< hat is the output of the following

 program$ Assume all necessary header files are

included% :

void main$ %

{

char 2 name/ +teAm&ndia,;for $ int i / !; name[i" 0 / J!K ; i 4 %

{ if $ islower$ name[i"% %

name[i" / toupper$name[i"% ;

else

name[i" / tolower$name[i"%; ' '

>> hat is the output of the following

 program$ Assume all necessary header files are >@ hat is the output of the following

1% | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 19: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 19/47

included% :

void main$ %

{ char 2 name/ +Ch bBt mA9 w&9s,;

for $ int i / !; name[i" 0 / J!K ; i 4 1%

{ if $ islower$ name[i"% %

name[i" / toupper$name[i"% ;

else

if$ isupper$name[i"% %

if $ i S / / !% name[i" PP ;

else

name[i" / tolower$name[i P 1" ' '

 program$ Assume all necessary header files are

included% :

void main$ %

{ char 2 str / +CAU,;

for $ int i / strlen$str% = 1 ; i R/ ! ; i PP%

{ for $ int ( / ! ; ( 7/ i ; ( 44%

cout77s[(" ; cout77,n,; ' '

>F hat is the output of the following

 program$ Assume all necessary header files are

included% :

void main$ %

{ int 2 p[1!";

int score[" / {I!) <!) H>) @!) <>) FH)!) NI';

for $ int i / ! ; score[i" 0/ ! ; i 44%

{ p[i" / score[i"; 2$p[i"% 4/ 1!; '

int count / !;

while$ count 7 i%

{ int q / 2$p[count"%;

count44 ;

if$q R @!%

cout77q77 +), ; ' '

>H hat will be the output of the following program

Q include7iostream.hR

Qinclude7ctype.hR

Qinclude7conio.hR

Qinclude7string.hR

void 9ewCe(t$char str[ ") int pos%

{

char 2 p / str;

int length / strlen$p%;

for$ ; pos 7 length P ; pos 4/ ) p44%

{ 2$p 4 pos% / toupper$2$p4pos%%; '

cout77str; '

void main$ %

{ clrscr$ %;

 9ewCe(t$+Lood 6orning,) !% ; '

@< *ind the output of the following programQ include7iostream.hR

void main $ %{

char 2name;node 2ne(t;

'

node n[ "/{

{+Anami8a,) n41'){+Bhruthi,)n4')

{+Bwathi,)n'

';node 2 m[<";for$int i/!;i7<;i44%

m[i"/n[i".ne(t;

cout.write$m[!"PRname)H%; cout.put$JnK%;

cout.write$$2m%PRname)H%; cout.put$JnK%;>N. rite a function in U44 to count the number of vowels present in a te(t file BCOW.CXC,.

BOOLEAN ALGEBRA1 Bolve the following *$a)b)c)d%/∑$!)1)<)>)@)H)I)N)11)1)1<)1@%. Obtain the simplified form using ZP6ap.

1& | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 20: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 20/47

6inimi3e * $a) b) c) d % / . _ 1) ) <) ) 11) 1) 1>) 1@% using ZPmap.

< Liven the logic function * / (y3 4 y3Kw 4 (Ky3. 6inimi3e it using ZP 6ap.

> Obtain a simplified form for the following Toolean (pression using Z 6ap and after simplifying draw its circuit

diagram.

*/m!4m14m4m>4m@4mH4mI4mN4m1!4m11

@ Obtain a simplified form for the following Toolean e(pression using ZP6ap and draw its circuit diagram.

*/6!.61.6<[email protected]!.61<

F Obtain the simplified form of a Toolean (pression using Zarnaugh 6ap

*$w)()y)3%/B$!)1))<)>)I)N)1!)11%

H educe the following Toolean (pression with the help of Zarnnaugh 6ap*$D)V))%/B$!)1))<)1)1<)1>)1@%

I Dse Z 6ap to simplify the Toolean function

*$a)b)c)d%/ ∑$1)<)>)@)F)H)N)11)1)1<)1>)1@%

N A combinational circuit has > inputs and one output. Output is 1 when

• all the inputs are equal to 1

• none of the inputs are equal to 1

• an odd number of inputs are equal to 1

$a% Obtain the truth table

$b% *ind the simplified output function in BO? *orm

$c% *ind the simplified output function in ?OB *orm

$d% #raw the logic diagram

1! Chere are > parallel railway trac8s at a place. &t is desired to design a logic circuit) which cangive a signal when three or more trains pass together at any given time

i% #raw the truth table for the above problem

ii% Bimplify the e(pression using Z = 6ap

iii% #raw the circuit diagram

11 Output of > input $()y)3)w% Toolean function * is 1 when

i% At least two variable have the truth value 1

ii% At least three variable have the truth value 1

iii% Only when the three variable have the truth value 1

#raw the truth table. Bolve it by using Z map in ?roduct of Bum terms

1 6inimi3e the Toolean (pression using XW4XWK4XWKK 4XKWKK4 XKW using Zarnaugh 6ap

1< Bimplify for the function */π$!)<)H)I)N)1)1<%

1> #raw the truth table for a full adder and then simplify the Bum and Uarry by using ZPmap. After that draw its circuitdiagram.

1@ Live the logic function */AT4AKTK4AKT. Assuming the complements are available. Bimplify the function using #e

6organKs Cheorem. Bynthesi3e * by using 9O gates only.

. Marks Questi!s Pr"ra##i!" i! C$$1. #efine a class Berial in U44 with the following specifications:

?rivate members of class Berial

. Berialcode integer 

. Citle ! characters

. #uration float

. 9oofepisodes integers

?ublic member function of class Berial

. A constructor function to initiali3e #uration as <! and noofepisodes as 1!

. 9ewserial function to accept values for serialcode and Citle.

. Otherenteries$ % function to assign the values of #uration and 9oofepisodes with the help

of corresponding values passed as parameters to this function.

#ispdata$ % function to display all the data members on the screen

. Uonsider the following and answer the questions given below: >

class university

{ int noc;

 protected:

char uname[@";

2' | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 21: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 21/47

 public:

university$ %;

char state[@";

void enterdata$ %;

void displaydata$ %; ';

class college : public university

{ int nod; char cname[@";

 protected:

void affiliation$ %;

 public:

college$ %;

void enroll$int)int%;

void show$ %; ';

class department : public college

{ char dname[@";

int nof;

 public:

department$ %;

void display$ %; void input$ %; ';

$i% hich classKs constructor will be called first at the time of declaration of an obEect of class department.

$ii% ow many bytes does an obEect belonging to class department requireM

$iii% 9ame the member function$s%) which can be accessed from the obEect$s% of class department.

$iv% 9ame the data member$s%) which are accessible from the obEect$s% of class college.<. #efine a class Flight in U44 with the following specification:

?rivate 6embers:

• A #ata 6ember *light 9umber of type integer 

• A #ata 6ember #estination of type Btring

• A #ata 6ember #istance of *loat Cype

• A #ata 6ember *uel of type float

A 6ember *unction Ual*uel$ % to calculate the value of fuel as per the following criteria:

#istance *uel 7/1!!! @!!

more than 1!!! and 7/!!! 11!!

more than !!! !!

Pu,+i' Me#,ers&

• A function *eed_&nfo$ % to allow user to enter values for *light 9umber) #estination) #istance Uall *unctionUal*uel$ % to calculate the quantity of fuel.

A *unction Bhow_*uel$ % to allow user to view the content of all the data members.

>. Answer the questions $i% to $iv% based on the following code:

class 69U

{ char Uname[@";

 protected: char office[@";

 public : 69U$ %;

char Uountry[@";

void nter#ate$ %;

void #isplay#ata$ %;

';

class TA9U:public 69U

{ long 9O;

char Utry[@" ;

 protected:

void Association$ %;

 public:

TA9U$ %;

void Add$ %; void Bhow$ %; ';

class ODCGC: public TA9U

{ char Btate[@";

 public:

21 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 22: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 22/47

ODCGC$ %;

void nter$ %; void Output$ %; ';

a% hich classKs constructor will be called first at the time of declaration of an obEect of class ODCGC.

 b% ow many bytes an obEect belonging to class ODCGC requireM

c% 9ame the member function$s% which are accessed from the obEect$B% of class ODCGC.

d% 9ame the #ata members which are accessible from the obEects$s% of class TA9U.

@. Uonsider the following and answer the questions given below

class UO

{

double Curnover; protected:

int 9oofcomp;

 public:

UO$ %;

void input$int%; void output$ %; ';

class #irector : public UO

{ int noofemp;

 public:

#irector$ %; void &9#ACA$ %; void ODC#AC$ %;

 protected:

float funds; ';

class 6anager: public #irector 

{ float e(penses; public:

void display$void %; ';

i% hich constructor will be called first at the time of declaration of obEect of class 6anagerM

ii% ow many bytes will an obEect belonging to the Ulass 6anager requireM

iii% 9ame the member functions) which can be accessed by an obEect of class 6anager.

iv% &s the member function ODC?DC$ % accessible by the obEects of the class #irector 

F. #efine a class TEST with the following specification:

?rivate members

Cestcode of type integer 

#escription of type string

 9oUandidate of type integer 

A member function CALCNTR/ 0 to calculate and return the number of centers as $

 9oUandidate 5 1!! 4 1%

?ublic members

A constructor function to initiali3e Cestcode as 1.

A function &9_#ACA$ % to accept values for Cestcode) #escription) 9oUandidate And call function UAGU9C$ %

A function ODC_#ACA$ % to display all the data members

H. #efine a class ?OC with the following specification

?rivate:

Adno > digit admission number 

 9ame ! characters

6ar8s an array of floating point values

Averge average mar8s obtained

Letavg$ % to compute the average obtained in five subEects

?ublic:eadinfo$ % function to accept values for adno) name) mar8s and

&nvo8e the function Letavg$ %

#isplayinfo$ % function to display all data members on the screen.

I. Uonsider the following U44 declaration and answer the questions given below:

class A

{

void any$ %;

 protected:

int a)b;

22 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 23: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 23/47

void proc$ %;

 public:

A$ %;

void get$ %; void put$ %; ';

class T:protected A

{ int c)d;

 protected:

int e)f; void get$ %;

 public:

T$ %;

void put$ %; ';

class U: private T

{ int p;

 protected:

int q;

void get<$ %;

 public:

void show<$ %; ';

$a% 9ame all the member functions which are accessible by the obEects of class U.

$b% 9ame all the protected members of class T.

$c% 9ame all the data members which are accessible from member functions of class U.

$d% ow many bytes does an obEect belonging to class U requireM

$e% hich class constructor will be called first at the time of declaration of an obEect of class UM$f% &s the member function proc$ %) which can be accessed form the obEects of class UM

$g% 9ame the base class and derived class of class T.

$h% 9ame all the protected members of class U.

N. Liven the following U44 code) answer the questions

Ulass CBC

{ int time;

 public:

CBC$ % 55*unction 1

{ time/!;

cout77 ,hai,; '

CBC$ % 55*unction

{ cout77 ,hello,; '

void e(am$ % 55*unction <

{ cout77,god bless u,; '

CBC$int #uration% 55*unction >

{ time/#uration; cout77,(am starts,; '

CBC$CBC C% 55*unction @

{ time / C.#uration; cout77,(am *inished, ' ';

$a% &n ObEect Oriented ?rogramming) what is *unction 1 referred as and when does it get invo8ed5calledM

$b% &n ObEect Oriented ?rogramming) what is *unction referred as and when does it get invo8ed 5 calledM

$c% hich category of constructors does *unction @ belong to and what is the purpose of using itM

$d% rite statements that would call the member *unction 1 and >.

1!. #efine a class in U44 with the following description :

• A data member TrainNumber 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 CALUEL/ 0 to calculate the value of *uel as per the following criteria :

Dista!'e ue+

7/1@!! @!

more than 1@!! and 7/<!!! 1!!!

more than <!!! @!!

?ublic 6embers

• A function *#&9*O$ % to allow user to enter values for the Crain 9umber) #estination)

2 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 24: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 24/47

#istance call function UAG*DG$% to calculate the quantity of *uel.

• A function BO&9*O$ % to allow user to view the content of all the data members.

11. Uonsider the following U44 declaration and answer the questions given below:

class ?DTG&B 

{

char pub[1";

double turnover;

 protected:

void register$ %;

 public:?DTG&B$ %;

void enter$ %; void display$ %; ';

class TA9U

{

char city[!";

 protected:

float employees;

 public:

TA9U$ %;

void haveit$ %; void giveit$ %; ';

class ADCO: private TA9U) public ?DTG&B 

{

int acode;char aname[!";

float amount;

 public:

ADCO$ %;

void start$ %; void show$ %; ';

$a% rite the names of data members) which are accessible from obEects belonging to class ADCO.

$b% rite the names of all the member functions which are accessible from obEects belonging to class TA9U.

$c% rite the names of all the members which are accessible from member functions of class ADCO.

$d% ow many bytes will be required by an obEect belonging to class ADCOM

$e% rite the public members of the class ADCO.

1. #efine a class BO? in U44 with the following description:

•  9ame of the owner • Uontact 9umber of owner 

• Address of shop

•  9umber of employees.

Pu,+i' Me#,ers

• A function A#_#ACA$ % to read the data.

• A function &C_#ACA$% to display the data.

#eclare an array of BO? to store the information for 1!! shops. Dse this array in main$ % and

display the information.

1<. #efine a class CBC6ACU in U44 with the following description :

Pri2ate Me#,ers

CestUode of type integer 

#escription of type string 9oofcandidates of type integer 

Uenterreqd $number of centers required% of type integer 

A member function UAGUDGACU9C$ % to calculate and return the number of centers as

$9OO*UA9#&#ACB 51!!41%

Pu,+i' Me#,ers

• A function LC#ACA$ % to allow user to enter values for Cest Uode) #escription)

 9oofcandidates call function UAGUDGACU9C$ % to calculate the number of 

centers.

• A function ?DC#ACA$ % to allow user to view the content of all the data members in

2! | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 25: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 25/47

the following format :

CBC 6ACU &9*O6AC&O9 PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP

Cest 6atch Uode : PPPPPPPPPPPP

#escription : PPPPPPPPPPPP

Cotal Uandidates : PPPPPPPPPPPP

Uenters equired : PPPPPPPPPPPP

1>. Uonsider the following U44 declaration and answer the questions given below:

class ?

{ char pub[1"; double turnover;

 protected:void register$ %;

 public:

?$ %;

void enter$ %; void display$ %; ';

class T

{ char city[!";

 protected:

float employees;

 public:

T$ %;

void haveit$ %; void giveit$ %; ';

class A: private T) public ?

{ int acode; char aname[!"; float amount; public:

A$ %;

void start$ %; void show$ %; ';

$a% rite the names of data members which are accessible from obEects belonging to class A.

$b% rite the names of all the member functions which are accessible from obEects belonging to class T.

$c% rite the names of all the members which are accessible from member functions of class A.

$d% ow many bytes will be required by an obEect belonging to class AM

$e% rite the public members of the class A.

1@ Answer the questions $i% and $ii% after going through the following class:

class &nterview

{ int month;

 public:

&nterview $int y% {month/y ;' 55Uonstructor 1

&nterview $&nterview t%; 55Uonstructor

';

$a% Ureate an obEect) such that it invo8es Uonstructor 1

$b% rite complete definition for Uonstructor

1F. #efine a class named A#6&BB&O9 in U44 with the following descriptions:

Pri2ate #e#,ers&

A#_9O integer $anges 1! P !!!%

 9A6 Array of characters $Btring%

UGABB Uharacter 

*B *loat

Pu,+i' Me#,ers&

• *unction ead_#ata $ % to read an obEect of A#6&BB&O9 type• *unction #isplay$ % to display the details of an obEect

• *unction #raw_9os $ % to choose students randomly and display the details. Dse

random function to generate admission nos to match with A#_9O.

1H. Answer the questions $i% to $iii% based on the following code:

class stationary

{

char Cype; char 6anufacturer [1!";

 public:

stationary$ %;

2" | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 26: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 26/47

void ead_sta_details$ %;

void #isp_sta_details$ %; ';

class office: public stationary

{ int no_of_types; float cost_of_sta;

 public:

void ead_off_details$ %; void #isp_off_details$ %; ';

class printer: private office

{ int no_of_users;

char delivery_date[1!";

 public:

void ead_pri_details$ %; void #isp_pri_details$ %; ';

void main $ %

{ printer 6y?rinter; '

$a% 6ention the member names which are accessible by 6y?rinter declared in main$ % function.

$b% hat is the si3e of 6y?rinter in bytesM

$c% 6ention the names of functions accessible from the member function

ead_pri_details $ % of class printer.

1I. #efine a class named ODB&9L in U44 with the following descriptions:

Pri2ate #e#,ers

L_9O integer$anges 1! 1!!!%

 9A6 Array of characters $Btring%

CW? Uharacter 

UOBC *loatPu,+i' Me#,ers

• *unction ead_#ata$ % to read an obEect of ODB&9L type.

• *unction #isplay$ % to display the details of an obEect.

• *unction #raw9os$ % to choose and display the details of houses selected randomly

from an array of 1! obEects of type ODB&9L. Dse random function to generate the

registration nos. to match with L9O from the array.

1N. Answer the questions $i% to $iii% based on the following code:

class furniture

{

char Cype;

char 6odel[1!";

 public:furniture$%;

void ead_fur_details$ %;

void #isp_fur_details$ %; ';

class sofa : public furniture

{

int no_of_seats;

float cost_of_sofa;

 public:

void ead_sofa_details$ %;

void #isp_sofa_details$ %;

';

class office: private sofa

{int no_of_pieces;

char delivery_date[1!";

 public:

void ead_office_details$ %;

void #isp_office_details$ %; ';

void main$ %

{ office 6y*urniture; '

$a% 6ention the member names which are accessible by 6y*urniture declared in main $ % function.

$b% hat is the si3e of 6y*urniture in bytesM

2# | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 27: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 27/47

$c% 6ention the names of functions accessible from the member function

ead_office_details $ % of class office.

!. #efine a class named 6OV& in U44 with the following description:

Pri2ate #e#,ers

AGG_9O integer 

6OV&_9A6 Array of characters $Btring%

Z integer $Cotal number of wee8s the same movie is shown%

Z_UOGGUC&O9 *loat

COCAG_UOGGUC&O9 *loat

Pu,+i' Me#,ers• *unction ead_#ata$ % to read an obEect of A#6&BB&O9 type

• *unction #isplay$ % to display the details of an obEect

• *unction Dpdate$ % to update the total collection and ee8ly collection once in a wee8 

changes. Cotal collection will be incremented by ee8ly collection and ee8ly

collection is made ero

1. Answer the questions $i% to $iii% based on the following code:

class toys

{

char Uode;

char 6anufacturer [1!";

 public:

toys$ %;

void ead_toy_details $ %;

void #isp_toy_details$ %;

';

class electronic : public toys

{

int no_of_types; float cost_of_toy;

 public:

void ead_elect_details $ %; void #isp_elect_details $ %; ';

class infants : private electronic

{

int no_of_buyers; char delivery date[1!";

 public:

void ead_infant_details $ %; void #isp_Enfant_details$ %; ';void main $ %

{ infants 6yCoy; '

$a% 6ention the member names which are accessible by 6yCoy declared in main $ % function.

$b% hat is the si3e of 6yCoy in bytesM

$c% 6ention the names of functions accessible from the member function

ead_infant_details $% of class printer.

Answer the questions $i% to $iv% based on the following:

class UDBCO6 

{

int cust_no; char cust_name[!";

 protected:

void egister$ %;

 public:

UDBCO6$ %;

void status$ %; ';

class BAGB6A9

{

int salesman_no;

char salesman_name[!";

 protected:

float salary;

 public:

2$ | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 28: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 28/47

BAGB6A9$ %;

void enter$ %; void show$ %; ';

class BO?: private UDBCO6) public BAGB6A9

{

char voucher_no[1!";

char sales_date[I";

 public:

BO?$ %;

void sales_entry$ %; void sales_detail$ %; ';

$i% rite the names of data members which are accessible from obEects belonging to class UDBCO6.

$ii% rite the names of all the member functions which are accessible from obEects belonging to class BAGB6A9.

$iii% rite the names of all the members which are accessible from member functions of class BO?.

$iv% ow many bytes will be required by an obEect belonging to class BO?M

< Answer the questions $i% to $v% based on the following code :class mployee

{ int id;

 protected:

char name[!"; char doE[!"; public :

mployee$ %;mployee$ %;

void get$ %; void show$ %; ';class #aily_wager : protected mployee

{ int wphour;

 protected :

int nofhwor8ed; public :

void getd$ %; void showd$ %; ';class ?ayment : private #aily_wager 

{ char date[1!";

 protected :

int amount; public :

?ayment$ %;?ayment$ %;

void show$ %; ';$i% 9ame the type of &nheritance depicted in the above e(ample.

$ii% 9ame the member functions) which are accessible by the obEects of class ?ayment.

$iii% *rom the following) &dentify the member function$s% that can be called directly from

the obEect of class #aily_wager class show$ %) getd$ %) get$ %$iv% *ind the memory si3e of obEect of class #aily_wager.

$v% &s the constructors of class mployee will copied in class ?aymentM #ue to inheritance.> Answer the questions $i% to $iv% based on following code:

class orld

{ int ; protectedint s;

 public:void &9?DC$int%; void ODC?DC$ %; ';

class Uountry : private orld{ int C;

 protected:

int D;

 public :

2% | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 29: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 29/47

void &9#ACA$int) int%; void ODC#ACA$%; ';class Btate : ?ublic Uountry

{int 6;

 public :

void #&B?GAW$void%; ';

$i% 9ame the base class and derived class of the class Uountry.$ii% 9ame the data member that can be accessed from function #&B?GAW$ %

$iii% 9ame the member functions) which can be accessed from the obEects of class Btate.$iv% &s the member function ODC?DC$% accessible by the obEects of the class Uountry M

@ Answer the questions $i% to $iv% based on the following class declaration:

class 6edicine

{ char category[1!";char #ate_of_6anufacture[1!";

char #ate_Of_(piry[1!"; protected:

char company[!"; public:

int ()y;

6edicine$ %; void nter$ %; void Bhow$ %; ';

class Cablet :protected 6edicine{ protected:

char tablet_name[<!";char volume_label[!";

void disprin$ %;

 public:

float price;Cablet$ %;

void enterdet$ %; void showdet$ %; ';class ?aineliever : public Cablet

{int #osage_units; long int tab; char effects[!";

 protected:

 int use_within_#ays;

 public :?aineliever$ %; void enterpr$ %; showpr$ %; ';

$i% ow many bytes will be required by an obEect of class #rug and an obEect of class ?ainelieverrespectively.

$ii% rite names of all the data members which are accessible from the obEect of class ?aineliever.

$iii% rite names of all member functions which are accessible from obEects of class ?aineliever.

$iv% rite the names of all the data members which are accessible from the functions enterpr$%.F Uonsider the following declarations and answer the questions given below:

class Animal

{ int leg: protected:int tail;

 public:

void &9?DC $int %; void ODC $ %; ';

class wild : private Animal{ int carniv;

 protected:int teeth;

?ublic:

2& | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 30: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 30/47

void &9#ACA $int) int % ; void ODC#ACA$ %; ';class pet : public Animal

{ int herbiv; public:

void #isplay $void%; ';

$i% 9ame the base class and derived class of the class wild.

$ii% 9ame the data member$s% that can be accessed from function #isplay $ %.$iii% 9ame the member function$s%) which can be accessed from the obEects of class pet.

$iv% &s the member function ODC $ % accessible by the obEects of the class wildMH Answer the questions $i% to $iv% based on the following code:

class vehicle

{

int wheels; protected:

int passenger; public:

void inputdata$ %; void outputdata$ %; ';class heavyvehicle : protected vehicle

{ int diesel_petrol;

 protected:

int load; public:

void readdata$int) int%; void writedata$ %;';class bus : private heavyvehicle

{

char ma8e[!";

 public:void fetchdata$ %; void displaydata$ %; ';

i% 9ame the base class and derived class of heavyvehicle class.ii% 9ame the data member$s% that can be accessed from the function displaydata$ %.

iii% ow many bytes will be required by an obEect of vehicle and heavyvehicle classes respectivelyMiv% &s the member function outputdata$ % accessible to the obEects of the class heavyvehicleM

I Answer the questions $i% to $iv% based on the following:

class Too8 

{ int year_publication; char title[@"; float price; public:

Too8$ %;void input_data$ %; void output_data$ %; ';

class Cape

{ char comp_name[!";

 protected:char comp_addr[<@";

 public:

Cape$ %; void read_data$ %; void show_data$ %; ';class ?ublication : private Too8 ) public Cape{

int no_copies;

 public:

?ublication$ %;void ?ub_ntry$ %; void ?ub_#etail$ %; ';

$i% rite the names of data members which are accessible from obEects belonging to class ?ublication.$ii% rite the names of all the member functions which are accessible from obEects belonging to class Cape.

$iii% rite in which order the constructors will be invo8ed when an obEect of class ?ublication is created .

' | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 31: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 31/47

$iv% ow many bytes will be required by an obEect belonging to class ?ublicationMN Uonsider the following declarations and answer the questions given below:

class 6ydata{ protected:

int data;

 public:

void Let_mydata$int%; void 6anip_mydata$int%; void Bhow_mydata$int%;6ydata$ %;

6ydata$ %; ';class ?ersonal_data

{

 protected:

int data1; public:

void Let_personaldata$int%; void Bhow_personaldata$int%; ?ersonal_data1$ %; ?ersonal_data1$ %;';

class ?erson: public 6ydata) ?ersonal_data{

 public:

void Bhow_person$void%; ?erson$ %; ?erson$ %; ';

i% ow many bytes will be required by an obEect belonging to class ?ersonMii% hich type of inheritance is depicted in the above e(ampleM

iii% Gist the data members that can be accessed by the member function Bhow_person$ %.iv% hat is the order of constructor e(ecution at the time of creating an obEect of class ?ersonM

<! Assuming the class Account given below and a binary file TA9Z.#AC contains obEects

of this class) write functions in U44 to perform the followings:

$i% #eposit $ %) which deposits amount ( to account number y.$ii% ithdraw $ %) which withdraws amount ( from account number y.

class Account{int acc_no;

char name[!";float balance;

 public:

float getTalance$ %

{ return balance ; 'void setTalance$float f %

{ salary / f; 'int get_acc_no$ %

{ return acc_no; ' ';

Data Stru'ture /Arra() Sta'k) Queue01 rite a function in U44 to perform a ?DB operation in a dynamically allocated stac8 

considering the following:

struct 9ode

{int ()y;

 9ode 2 Gin8; ';

rite a function in U44 to combine the contents of two equiPsi3ed arrays A and T by computing their corresponding

elements with the fornula 2A[i"4<2T[i") where value & varies from ! to 9P1 and transfer the resultant content in the

third same si3ed array.

< rite a function in U44 to merge the contents of two sorted arrays A and T) into the third array U. Assume array A is

sorted in ascending order) T is sorted in descending order) the resultant array is required to be in ascending.

> rite a function in U44 which will accept a # Array of integer and return the sum of all the elements divisible by @

that lie on the even row number.

1 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 32: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 32/47

@ Assume an array A containing elements of structure Accountant is required to be arranged in descending order of

salary. rite a U44 program to arrange the same with the help of bubble sort. Che array and its si3e is required to be

 passed as parameters to the functions. #efinition of structure Account is as under:

struct Account

{ int Accno;

char A9ame[@"; ';

F Liven two arrays of integers ( and y of si3es m and n respectively. rite a function named

6L$ % which will produce a third array named 3) such that the following sequence is

followed:

$i% All odds numbers of ( from left to right are copied into 3 from left to right.$ii% All even number of ( from left to right are copied into 3 from right to left.

$iii%All odd numbers of y from left to right are copied into 3 from left to right.

$iv%All even number of y from left to right are copied into 3 from right to left.

g: ( is{<))1)H)F)<'

And y is {N)<)@)F))I)1!'

Chen 3 / {<)1)H)<)N)<)@)1!)I))F)F)'

H rite a program to multiply two given # 6atrices using functions.

I rite a user defined function named upperhalf$ % which ta8es a # array A) with si3e n rows

and n cols as arguments and print the upper half of the matri(

1 < 1 <

F H I H I

< > >

N rite a user defined function named lowerhalf $% which ta8es a # array) with si3e n) n rows

and n cols as arguments and prints the lower half of the matri(.

g;

1 < 1

@ F H @ F

N 1 N 1

1! rite a function in U44 which accepts an integer array and its si3e as arguments and replaces

elements having even values with its half and elements having odd values with twice its value .

eg:

if the array contains

<) >) @) 1F) N

then the function should be rearranged as

F) )1!)I) 1I11 rite a function in U44 which accepts an integer array and its si3e as argument 5 parameters

and assign the elements into a two dimensional array of integers in the following format.

&f the array is 1 < > @ F

1 < > @ F

1 < > @ !

1 < > ! !

1 < ! ! !

1 ! ! ! !

1 ! ! ! ! !

1 Uonsider the following statements

Uhar ch)ch1/KAK;

Uhar 2p)2p1/ch1;

2p1/ch141;

2p/ch;

Buppose each character occupies bytes of memory. &f the value assigned to ch is stored in

address !( and the value assigned to ch1 is stored in address !(1!@ then

$i% what value is assigned to p1;

$ii% what is the value of 2p1;

$iii% what value is assigned to chM

$iv% hat value is assigned to 2pM

1< rite a function in U44 which accepts a # array of integers and ts si3e as arguments and

displays the elements of middle row and the elements of middle column. Assuming the #

2 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 33: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 33/47

array to be a square matri( with odd dimensions i.e.) <(<) @(@) H(H

eg.)

> @ F

H I N

< 1

output through the function should be

middle row H I N

middle col. @ I

1> #efine a function eversearray$int[") int% that would accept a one dimensional integer array

 9D6TB and its si3e 9. Che function should reverse the content of the array without usingany second array.

 9ote: use the concept of swapping the elements.

g; if the array initially contains

)1@)H)I)1!)1)1<

after swapping should contain <1)1)1!)I)H)1@)

1@ Liven an array named A with following elements

<)P@)1)<)H)!)P1@)<)PH)PI

write a U44 function to shift all the negative numbers to left so that the resultant array may loo8 

li8e

P@)P1@)PH)PI)<)1)<)H)!)<

1F rite a function in U44 which accepts an integer array and its si3e as arguments and swaps the

elements of every even location with its odd location

eg.) if the array initially contains) >) 1) F) @) H) N) ) <) 1!

then it should contain

>) ) F) 1) H) @) ) N) 1!) <

1H *rom a # array A[<"[<" write a program to prepare one dimensions array A[N" that will

have all the elements of A as if they are stored in row maEor form.

1 <

> @ F

H I N

then should contain 1<>@FHIN

1I Uonsider a 1# array A containing 9 integers. #evelop an algorithm to do the following.

$i% emove all occurrences of a given integer 

$ii% Bhift the elements of the array to the right so that unused space is available at the left end.$iii% *ill the unused spaces with 3ero.

1N Arrange the following array of integers in ascending order using bubble sort technique.

Array elements are: F) 1) !) <) N) 1H) 1>

! rite a function chec8$ % to chec8 if the passed array of 1! integers is sorted or not. Che function should return 1 if

arranged in ascending order) P1 if arranged in descending order) ! if it is not sorted.

1 Buppose a company 8eeps single dimensional array WA[1!!" such that WA[Z" contains the number of

employees appointed in the year Z. rite a U44 program for each of the following tas8:

a. Co print each of the years in which no employee was appointed.

 b. Co find the number of years in which no employee was appointed.

rite a user defined function in U44 to find the sum of all positive numbers of a # array AU [H"[H" containing

integers.

< rite an interactive menu driven program to create two <(< matrices and carry out the following operations.a. Bum of two matrices

 b. difference of two matrices

c. ?roduct of two matrices

#isplay the input and output matrices in proper matri( form. hile creating the matri( 8eep in mind that each input

must not e(ceed !.

> rite a function in U44 to perform a ?DB operation in a dynamically allocated stac8 

considering the following;

struct 9ode

{

int () y;

 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 34: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 34/47

 9ode 2Gin8; ';

@ rite a function in U44 to perform insert operation in dynamically allocated ]ueue containing

names of students.

F rite a function in U44 to perform push operation in a dynamically allocated stac8 containing

admission number of students. Also declare the relevant class5 structure and pointers.

H rite a function in U44 to perform a #GC operation in a dynamically allocated queue

considering the following description:

Btruct 9ode

{ float D)V;

 9ode 2Gin8;';

class ]DD

{ 9ode 2ear) 2*ront;

?ublic:

]DD$ % { ear /9DGG; *ront/ 9DGG;'

void &9BC $ %;

void #GC $ %;

]DD $ %;';

I rite a function in U44 to perform a ?DB operation in a dynamically allocated stac8 

considering the following :

Btruct 9ode

{ int X)W;

 9ode 2Gin8;';

class BCAUZ 

{ 9ode 2 Cop;

Pu,+i'&

BCAUZ$ % { CO?/9DGG;'

void ?DB$ %;

void ?O?$ %;

BCAUZ$ %; ';

N #efine function stac8push$ % to insert nodes and stac8pop$ % to delete nodes) for a lin8ed list

implemented stac8 having the following structure for each node:

struct 9ode

{ char name[!";int age;

 9ode 2Gin8;

';

class BCAUZ 

{ 9ode 2 Cop;

 public:

BCAUZ$ % { CO?/9DGG;'

void stac8push$ %;

void stac8pop$ %;

BCAUZ$ %;';

<! Uonsider the following portion of a program which implements passengers ]ueue for a bus.

rite the definition of function &nsert$ % to insert a new node in the queue with required

information.struct 9ode

{ float D)V;

 9ode 2Gin8;

';

class ]DD

{ 9ode 2ear) 2*ront;

?ublic:

]DD$ % { ear /9DGG; *ront/ 9DGG;'

Void &9BC $ %;

! | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 35: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 35/47

Void #GC $ %;

]DD $ %; ';

<1 Live the necessary declaration of a lin8ed list implemented queue containing float type values .

Also write a user defined functions in U44 to add and delete a float type number in the queue.

< An array ([I"[!" is stored in the memory with each element requiring bytes of storage. &f the base address of the

array is @!!) calculate the location of ([@"[@" when the array ( is stored using the column maEor order and row maEor

order.

<< An array Arr[1..!"[1..!" is stored in the memory with each element requiring > bytes of storage. &f the base addres

of array Arr is !!!) determine the location of Arr[1@"[N" when the array Arr is stored in $1% ow wise and $% Uolumn

wise.<> An array 6AC[<!"[1!" is stored in the memory row wise with each element occupying I bytes of memory. *ind out

the base address and the address of the element 6AC[1@"[@") if the location of 6AC[@"[H" is stored at the address <!!!.

<@ An array 6AC[!"[@" is stored in the memory with each element requiring bytes of storage. &f the base address of

6AC is >!!! 6AC[[1"[I" when the array stored in $i% 6O and $ii% U6O

<F An array A[1@"[!" is stored in the memory) along the row with each element occupying > bytes . *ind out the

 base address and the address of the element A[<"[" if the element A[@"[" is stored at the address 1@!!.

<H &f an array T[11"[I" is stored as column wise and T["[" is stored at 1!> and T[<"[<" at 1!I>)

find the address of T[@"[<" and T[1"[1".

<I An array Arr[@![1!!" is stored in the memory along the row with each element occupying bytes. *ind out the

address of the location A[!"[@!" if location of Arr[!"[<!" is 1<@!.

<N An array ([<!"[1!" is stored in the memory with each element requiring > bytes of storage. &f the base address of ( i

>@!!) find out memory locations of ([1"[I" and (["[>") if the content is stored along the row.>! An array A[1@"[<@" is stored in the memory along the column with each of its elements occupying I bytes. *ind

out the base address and the address of an element A["[@" ) if the location is stored at the address >!!!

>1 An array X[1@"[1!" is stored in memory with each element requiring bytes of storage. &f the base address of array i

!!!) calculate the location of X [H"[I" when the array is stored by $1% row maEor order $% column maEor order.

> X [1..F"[1.1!" is a two dimensional array. Che first element of the array is stored at location 1!!. ach element of

the array occupies F bytes. *ind the memory location of X["[>" when $i% array is stored row wise. $ii%array is stored

column wise

>< ach element of an array A[P!..!)1!..<@" requires one byte of storage. &f the array is stored in column maEor order

 beginning location @!!) determine the location of A[!)<!".

>> An array B[<@"[1@" is stored in the memory along the row with each of its elements occupying >bytes. *ind out the

memory location for the element B[!"[@") if an element B["[" is stored at the memory location <!!!.

>@ Liven the two dimensional array a[1!"[!" base address of a is 1!! and width of each elementis > bytes. *ind the location of a[I"[1@" when the array is stored as columnPwise and rowPwise >F An array A[P..I"[P

..@" is stored in the memory along the column with each element occupying > bytes. *ind out the address of the elemen

A[<"[".

>H An Array Val[1..1@"[1..1!" is stored in the memory with each elements requiring > bytes of storage. &f the base

address of array Val is 1@!!) determine the location of Val [1"[N" when the array Val is stored $i% row wise $ii% column

wise.

>I A Pd array defined as A[>..H) P1..<" requires words of storage space for each element.calculate the address of

A[F)") given the base address as 1!!) also calculate the address of A[H)!" &f the array is stored in row maEor order 

>N &f an array T[11"[I" is stored as column wise and T["[" is stored at 1!> and T[<"[<" at 1!I>.

*ind out the base address) si3e of an element and address of T[@"<".

@! An array A[<@"[1@" is stored in the memory along the row with each of its element occupying > bytes. *ind out

the base address and the address of an element A[!"[@") if the location A["[" is stored at the address <!!!.@1 An array B[>!"[<!" is stored in the memory along the row with each of the element occupying > bytes) find out the

memory location for the element B[1@"[@") if an element s[!"[1!" is stored at memory location @H!!

@ An array A[1!"[!" is stored in the memory with each element occupying bytes of space.Assuming the base

address of A to be I!!)compute the address of A[N"[11") when the array is stored as :i% ow wise ii% Uolumn wise

@< An Array Val[1..1@"[1..1!" is stored in the memory with each elements requiring > bytes of storage. &f the base

address of array Val is 1@!!) determine the location of Val [1"[N" when the array Val is stored $i% row wise $ii% column

wise.

@> A # array defined as A[>..H) P1..<" requires words of storage space for each element calculate the address of

A[F)") given the base address as 1!!) also calculate the address of A[H)!") if the array is stored in row maEor order

" | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 36: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 36/47

@@ An array A[<@"[1@" is stored in the memory along the row with each of its element

occupying > bytes. *ind out the base address and the address of an element A[!"[@") if the location A["[" is

stored at the address <!!!.

@F An array B[>!"[<!" is stored in the memory along the row with each of the element occupying >

 bytes) find out the memory location for the element B[1@"[@") if an element s[!"[1!" is stored at

memory location @H!!.

@H An array A[1!"[!" is stored in the memory with each element occupying bytes of space.

Assuming the base address of A to be I!!)compute the address of A[N"[11") when the

array is stored as : i% ow wise ii% Uolumn wise

@I An array Y[1@"[1!" is stored in memory with each element requiring two bytes of storage. &f the base address of Y is <!!!) determine the location of Y[I"[H" when the array Y is stored by $i% ow

6aEor) $ii% Uolumn 6aEor.

@N An array X[11F!"[11!" is a two dimensional array. Che first element of the array is stored

at location 1!!. ach element of array occupies F bytes. *ind the memory location of X["[>"

when array is stored in row wise and column wise.

F! rite a function in U44 to find the sum of both left and right diagonal elements from a two

dimensional array $6atri(%.

F1 An array Z containing double datatype is arranged in ascending order. rite a user defined

function in U44 to search for a number from Z with the help of binary search method. Che

function should return an integer ! to show absence of the number and integer 1 to show

 presence of the number in the array. Che function should have the parameters as $i% an array Z 

$ii% the number #ACA to be searched $iii% number of elements 9.F Buppose X) W and are arrays of integers of si3e 6) 9 and 649 respectively. Che numbers in

the array X appear in ascending order whereas in array W are descending order. rite a user 

defined function to merge the two arrays into third array in ascending order.

F< rite a function in U44 which accepts an integer array and its si3e as arguments and replaces

elements having odd values with thrice its value and elements having even values with their 

squares.

F> rite a program to create and display the list of patients in a small hospital using lin8ed list data

structure. ach node contains the name of the patient) age and admission number.

F@ ach node of a stac8 contains the following information in addition to pointer field:

$i% 9ame of the Uity

$ii% ?incode of the Uity

Live the Btructure of node for the lin8ed stac8 in question. Cop is a pointer that points to

the topmost node of the stac8. rite the following functions:$a% ?DB $ %: Co push a node into the stac8) which is allocated dynamically.

$b% ?O? $ %: Co remove a node from the stac8 and release the memory.

FF Ulass Btac8 

{

int data[1!";

int top;

 public:

stac8 $ % {top / P1;'

void push$ %; 55 Co push an element into the stac8 

void pop$ %; 55 Co pop an element from the stac8 

void #elete$int &C6 %; 55 Co delete all elements that are equal to &C6

';Uomplete the class with all function definitions. Dse another stac8 to transfer data temporarily.

FH *or a circular queue with @ memory locations) show diagrammatically the status of the queue

after each of the following operations:

$i% 1) and < inserted.

$ii% 1 deleted

$iii% >) @) inserted

$iv% ) < deleted

$v% F inserted and > deleted

$vi% H) I inserted

# | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 37: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 37/47

$vii% @) F deleted

$viii% 11 inserted

$i(% H) I deleted and 11 deleted

FI *or a circular queue with @ memory locations show diagrammatically the status of the *O9C

and A after each of the following operations:

$i% ) # and U inserted.

$ii% deleted

$iii% L) inserted

$iv% #) U deleted

$v% *) Z inserted$vi% L deleted

$vii% ) X inserted

$viii% ) * deleted

$i(% G inserted

$(% X deleted

FN rite an interactive menu driven program to implement circular queue using array consisting of 

character data value.

H! #efine member function ]ue&nsert$ % to insert and ]ue#el$ % to delete nodes of a lin8ed list

implemented class ]ueue having the following #efinitions:

Btruct 9ode

{ char name[!";

int age;

 9ode 2Gin8;';

class ]ueue

{ 9ode 2ear) 2*ront;

 public:

]ueue$ % { ear/9DGG; *ront / 9DGG'

void ]ue&nsert$ %;

void ]ue#el$ %;

';

H1 rite a function in U44 to &9BC operation in a dynamically allocated stac8 

considering the following description.Btruct 9ode

[float D) V; 9ode 2Gin8; ';

class ]DD{ 9ode 2ear) 2front;

?ublic:]DD$%

{ ear/ 9DGG; *ront/ 9DGG; '

void &9BC$%; void #GC$%; ';

H rite a function that reads 1! integers into the array A. Dse another integer array ? of same si3e to store each inde( of the array A in the following way:

Che inde( of the first smallest element in A is stored at inde( ! of ?) the inde( of the ne(tsmallest element in A is stored at inde( 1 of ? and so on. ?rint the ne(t smallest element

in A ordered in the sequence given by each succeeding inde( stored in ?.H< rite a user defined function to sort the given array using Belection sort mechanism.

int A[ " / {1!)1>)1F)<)F)<<)>>)>I)@!)@@)F!)FF';

?rint array after each iteration.

H> rite a user defined function to search for @@ and < in the following array.1!)1>)1F)<)F)<<)>>)>I)@!)@@)F!)FF

6a8e use of binary search method.H@ Dsing a two dimensional A[n ( n") write a function to prepare one dimensional array

Array[n" that will have all the elements of A as if they were stored in Uolumn maEor 

$ | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 38: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 38/47

order.HF rite a function to search for a given number in a given array A[n" using linear 

search technique. &f the number is found) move it at the top of the array. &f the number isnot found) insert it at the end of the array.

HH. rite a user defined function to sort the array $same as above% using insertion sort in

descending order. Live the array status after each iteration

HI rite a user defined function to sort the array$same as above% using bubble sort indescending order. Live array status after each iteration

HN hat would be the output of the followingM Assume that the array starts at location @H1>in the memoryM

Q include7iostream.hR

void main$%

{int tab[<"[>"/{ @)F)H)I)

1))<)>)N)1!)!)11';

cout77,n,772tab[!"77, +772$tab[!"41%;cout77,n,772$2$tab4!%41%;

'

I! rite a user defined function to generate the pyramid from string arr$+1<>@FHIN,%.

1 <

< > @ > <> @ F H @ F >

and so on.

Net3rki!" a!* C##u!i'ati!1 Zing Boft Organi3ation has set up its new center at 6umbai for its office and web based

activities. &t has > bloc8s of buildings as shown in the diagram below.

Tloc8 A

Tloc8 T

a% Buggest a cable layout of connections between the bloc8s.

 b% Buggest the most suitable place$i.e.bloc8 % to house the server of this organi3ation with a

suitable reason.c% Buggest the placement of the following devices with Eustification.

a. epeater 

 b. ub5Bwitch

d% Che organi3ation is planning to lin8 its front office situated in the city in a

e% illy region where cable connection is not feasible) suggest an economic way to connect it

with reasonably high speed.

Tloc8 

U

Tloc8#

Znowledge supplement Organi3ation has set up its new center at 6angalore for its office and

web based activities. &t has > Tloc8s of buildings as shown in the diagram below:

P a g e | 67Uenter to center distance between various bloc8s 9umber of Uomputers

Tloc8 A to Tloc8 T @! m

Tloc8 T to Tloc8 U 1@! m

Tloc8 U to Tloc8 # @ m

Tloc8 A to Tloc8 # 1H! m

Tloc8 T to Tloc8 # 1@ m

Tloc8 A to Tloc8 U N! m

i. Buggest a most suitable cable layout of connections between the Tloc8s.

ii. Buggest the most suitable places $i.e. Tloc8% to house the server of this organi3ation

with a suitable reason.

% | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 39: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 39/47

iii. Buggest the placement of the following devices with Eustification:

a. epeater b. ub5Bwitch

Che organi3ation is planning to lin8 its head office situated in Uity in a hilly region where cable

connection is not feasible) suggest an economic way to connect it with reasonably high speedM

Tloc8 A @

Tloc8 T @!

Tloc8 U 1@

Tloc8 # 1!

< CZ6 Uentenary public school in Zollam is setting up the networ8 between its different wings.

Chere are four wings named as Beniors $B%) Zids $Z%) Yuniors $Y% and ostel $%.#istance between various buildings is given below:

ing Z to B 1!!m

ing Z to Y !!m

ing Z to >!!m

ing B to Y <!!m

ing B to 1!!m

ing Y to >@!m

$i% Buggest a valid topology for networ8ing the computer of all wings

$ii% 9ame the wing where the server to be installed. Yustify your answer.

$iii%Buggest the placement of ub or Bwitch in the networ8.

$iv% Buggest a most suitable cable layout of connections between the wings.

ing Z 1! Uomputers

ing Y 1!! Uomputersing @! Uomputers

ing B !! Uomputers

< YUC &ndustries has set up its new center at Uhohal for its office and web based activities. Che

company compound has > bloc8s as shown in the diagram below:

Tloc8 A

Tloc8 T

Tloc8 UTloc8 #

Tloc8 A Block CUenter to center distances between various bloc8s is as follows:

Tloc8 A to Tloc8 T @! m

Tloc8 T to Tloc8 U 1<! mTloc8 U to Tloc8 # H! m

Tloc8 A to Tloc8 # 1I! m

Tloc8 T to Tloc8 # 1F! m

Tloc8 A to Tloc8 U I! m

 9umber of Uomputers in each of the bloc8s is as follows:

Tloc8 A <!

Tloc8 T F!

Tloc8 U 1<@

Tloc8 # 1@

1% Buggest a cable layout of connections between the bloc8s.

% Buggest the most suitable place $i.e.bloc8% to house the server of 

this company with a suitable reason.

<% Buggest the placement of the following devices with Eustification:$i%epeater 

$ii% Bwitch5ub

>% 6ention the economic technology to provide internet accessibility to all bloc8s.

> ATU Organi3ation has set up its new center at Lurgaon for its office and web based activities. &t

has > bloc8s of buildings as shown in the diagram below.

Che distances between the building are as :

Tloc8 A to Tloc8 UP 1! meters

Tloc8 A to Tloc8 TP ! meters

Tloc8 A to Tloc8 #P @@! meters

& | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 40: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 40/47

Tloc8 T to Tloc8 #P I! meters

Tloc8 # to Tloc8 UP 11! meters

Block B Block DBlock CBlock DBlock BBlock ATloc8 T to Tloc8 UP I! meters

Che number of computers in each Tloc8 are as follows:

Tloc8 A P 1!

Tloc8 T P 1I!

Tloc8 U P !

Tloc8 # P 11!

$i% Buggest a cable layout of connections between the bloc8s and type of cable.

$ii% Buggest the most suitable place $i.e. bloc8% to house the server of this organi3ation with a

suitable reason.

$iii% Buggest the placement of the following devices with Eustification.

1. epeater 

. ub5Bwitch

Che organi3ation is planning to lin8 its front office situated in the city in a illy region where

cable connection is not feasible) suggest an economic way to connect it with reasonably high

speed.

@ &ndian &ndustries has the following four buildings in Uhennai.#istance between various wings is given below:

ing &&1 to ing && < H!m

ing &&1 to ing && !m

ing && 1 to ing && > 11@m

ing && < to ing && > <!m

ing && to ing &&< @m

Nu#,er 4 C#5uters

ing && 1 <@

ing && @

ing && < I!

ing && > F!

i. Buggest suitable UATG GAWODCB *O CB TD&G#&9LB.

ii. 9ame the wing where the Berver is to be installed.

Yustify your answer.

iii. Buggest the placement of ub5Bwitch in the networ8.

iv. 6ention an economic technology to provide &nternet accessibility to all wings.

II1 II 2II 3II 4

F industan Uonnecting orld Association, is planning to start their offices in four maEor cities

in &ndia to provide regional &C infrastructure support in the field of ducation Uulture. Che

company has planned to set up their head office in 9ew #elhi in three locations and have named

their 9ew #elhi offices as +Bales Office,) +ead Office, and +Cech Office,. Che companyKs

regional offices are located at +Uoimbatore,) +Zol8ata, and +Ahmedabad,.

A rough layout of the same is as follows:Appro(imate distances between these offices as per networ8 survey team is as follows:

?lace *rom ?lace Co #istance

ead Office Bales Office 1! Z6

ead Office Cech Office H! 6eter 

ead Office Zol8ata Office 1N1 Z6

ead Office Ahmedabad Office HN! Z6

ead Office Uoimbatore Office 1N@ Z6

&n continuation of the above) the company e(perts have planned to install the following number 

of computers in each of their offices:

!' | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 41: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 41/47

ead Office 1!!

Bales Office !

Cech Office @!

Zol8ata Office @!

Ahmedabad Office @!

Uoimbatore Office @!

$i% Buggest networ8 type $out of GA9) 6A9) A9% for connecting each of the following set of 

their offices:

P ead Office and Cech Office

P ead Office and Uoimbatore Office

$ii% hich device will you suggest to be procured by the company for connecting all the

computers within each of their offices out of the following devicesM

P 6odem

P Celephone

P Bwitch5 ub

$iii% hich of the following communication media) will you suggest to be procured by the

company for connecting their local offices in 9ew #elhi for ver effective and fast

communicationM

P thernet Uable

P Optical *iber 

P Celephone Uable

$iv% Buggest a cable5 wiring layout for connecting the companyKs local offices located in 9ew

#elhi. Also) suggest an effective method5 technology for connecting the companyKs regionaloffices at +Zol8ata,) +Uoimbatore, and +Ahmedabad,.

6 Marks Questi!sSQL]1. rite B]G commands for $a% to $ E% and write output for $h% on the basis of Ceacher relation given

 below.

 9o 9ame Age #epartmen

t

#ate of

 Eoin

Balary Be(

1. Yigal <> Uomputer 1!5!15NH 1!!! 6

. Bharmila <1 istory >5!<5NI !!!! *

<. Bandeep < 6aths 1515NF <!!!! 6

>. Bangeeta <@ istory !15!H5NN >!!!! *

@. a8esh > 6aths !@5!N5NH @!!! 6F. Bhyam @! istory H5!5NH <!!!! 6

H. Bhiv Om >> Uomputer @5!5NH 1!!! 6

I. Bhala8ha << 6aths <15!H5NH !!!! *

a% Co show all information about the teacher of history department.

 b% Co list the names of female teachers who are in 6aths department

c% Co list names of all teachers with their date of Eoining in ascending order.

d% Co display students name) fee)age for male teacher only

e% Co count the number of teachers with ageR<.

f% Co insert a new row in the CAU table with the following data:

7)8Ra9a8)%6)8C#5uter8)1-:;<:7<)%-;;)8M8=

g% Co show all information about the teachers in this table

h% Add a new column named +Address,.

i% Arrange the whole table in the alphabetical order to name E% #isplay the age of the teachers whose name starts with JB).

8% Live the output of following statement.

$E% Belect UOD9C$distinct department% from CAU.

$ii% Belect 6AX$Age%from Ceacher where se(/,*,

$iii% Belect AVL$Balary% from Ceacher where #ateofEoin715!H5NF

$iv% Belect BD6$Balary% from teacher where #ateofEoin715!H5NF

]. TABLE & EMP

EMPNO ENAME >OB MGR HIREDATE SAL COMM DEPTNO

HI<N A 6A9AL FH 1P#UPNI @!!! ! 1!

!1 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 42: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 42/47

1<> ?6 UGZ IH 11P*TPHH 1!!! 1@!! !

FH@> B&CA 6A9AL IN 1P6APNN 1!!!! 1!!! !

F@H> L&CA BAGB6A

 9

NI 11PYD9PNN N!!! ! <!

NIHF O9W UGZ F@ 1PYD9P!! 1!!! I!! !

INHF 6A BAGB6A

 9

N1 1!PB?PII F!!! 1!! <!

$a% #isplay names of employees whose names include either of the substring +C, or +GG,.

$b% #isplay data of all employees sorted by their department) seniority and salary.

$c% *ind all the employees who have no manager.$d% Co display all employees who were hired during 1NN@.

$e% Bhow the average salary for all departments with more than < people for a Eob.

$f% *ind out number of employees having J6A9ALK as Eob.

$g% Ureate view #?C! with name and the salary of employees for dept !.

$h% #isplay department no. and number of employees in each department.

$i% *ind the output of the following :

1. BGUC BWB#AC *O6 #DAG;

. BGUC 9A6)BAG *O6 6?GOW #?C9O/!;

<. BGUC UOD9C$2% *O6 6?;

>. BGUC AVL$BAG% *O6 6?;

Q-. Uonsider the following OZB and #B&L. rite B]G commands for the statements $i% to

$iv% and give outputs for B]G queries $v% to $viii%?ORKERS

?@ID IRSTNAME LASTNAME ADDRESS CIT

1! Bam Cones <<lmBt. ?aris

1!@ Barah Ac8erman >>!D.B.11! 9ew Wor8  

1>> 6anila Bengupta >*riendsBtreet 9ew #lhi

1! Leorge Bmith I<*irstBtreet oward

@@ 6ary Yones I>VineAve. Gosantiville

<!! obert Bamuel N*ifthUross asington

<<@ enry illiams 16ooreBtreet Toston

>!< onny Gee 11arrisonBt. 9ew Wor8  

>@1 ?at Chompson 11edoad ?aris

DESIG

?@ID SALAR BENEITS DESIGNATION

1! H@!!! 1@!!! 6anager  

1!@ I@!!! @!!! #irector  

1>> H!!!! 1@!!! 6anager  

1! H@!!! 1@!! 6anager  

@@ @!!!! 1!!! Uler8  

<!! >@!!! 1!!!! Uler8  

<<@ >!!!! 1!!!! Uler8  

>!! <!!! H@!! Balesman

>@1 I!!! H@!! Balesman

$i% Co display _&#) *&BC9A6) A##BB and U&CW of all employees living in 9

WOZ from the table OZB.

$ii% Co display the content of wor8ers table in ascending order of GABC9A6.$iii% Co display the *&BC9A6) GABC9A6 and total salary of all aler8s from the

tables OZB and #B&L9) where total salary is calculated as BAGAW 4

T9*&CB.

$iv% Co display the minimum salary among 6anagers and Uler8s from the table #B&L.

$v% Live the output of following:

a. BGUC *&BC9A6) BAGAW *O6 OZB) #B&L

#B&L9AC&O9 / J6anagerK A9# OZB._&# / #B&L._&#

 b. BGUC UOD9C$#&BC&9UC #B&L9AC&O9% *O6 #B&L.

c. BGUC #B&L9AC&O9) BD6$BAGAW *O6 #B&L9AC&O9 LOD? TW

!2 | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 43: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 43/47

#B&L9AC&O9 AV&9L UOD9C$2%7<;

BGUC BD6$T9*&CB% *O6 OZB #B&L9AC&O9 / JBalesmanK;

Q.. rite the B]G commands for the following on the basis of tables &9C&OB and 9O9B

Cable: &9COB

B9O &C69A6 CW? #ACO*BCOUZ ?&U #&BUOD9C

1 edose #oubleTed <5!5! <!!! 1@

BoftCouch TabyUot !5155! N!!! 1!

< YerryKsome TabyUot 1N5!5! I@!! 1!

> oughood OfficeCable !15!15! !!!! !

@ Uomfortone #oubleTed 15!15! 1@!!! !F YerryGoo8 TabyUot >5!5! H!!! 1N

H GionZing OfficeCable !5!5! 1F!!! !

I oyalCiger Bofa 5!5! <!!!! @

N ?ar8 BittingBofa 1<515!1 N!!! 1@

1! #ine?aradise #iningCable 1N5!5! 11!!! 1@

Cable: 9O9B

B9O &C69A6 CW? #ACO*BCOUZ ?&U #&BUOD9C

11 hite ood #ouble

Ted

<5!5! !!!! !

1 Yames !!H Bofa !5!5!< 1@!!! 1@

1< Com Goo8 Taby Uot 15!5!< H!!! 1!

$i% Co list the &C69A6 which are priced at more than 1!!! from the &9C&OB table

$ii% Co list &C69A6 and CW? of those items) in which #ACO*BCOUZ is before 5!15! from the &9C&OB

table in descending order of &C69A6

$iii% Co show all information about the sofas from the &9C&OB table

$iv% Co display &C69A6 and #ACO* BCOUZ of those items in which the discount percentage is more than 1@

from &9C&OB table

$v% Co count the number of items) whose type is +#ouble Ted, from &9C&OB table

$vi% Co insert a new row in the 9O9B table with the following data

1>),Crue &ndian,) +Office Cable,) I5!<5!<)1@!!!)!

c% Let the Output $Dse the above table without inserting the record%

Belect UOD9C$distinct CW?% from &9C&OB

Belect AV$#&BUOD9C% from &9C&OB where CW?/,Taby Uot,

Belect BD6$?rice% from &9C&OB where #ACO* BCOUZ7{15!5!'Belect 6AX$?rice% from &9C&OB ) 9O9B;

]@. Liven the following tables for a database *D9&CD : 9ote: rite B]G

command for (a ) to $d% and write the outputs for $e% on the basis of tables *D9&CD and A&VAGB.

Cable: *D9&CD

 9O. &C69A6 CW? #ACO*BCOUZ ?&U #&BUOD9C

1 hitelotus #oubleTed <5!5! <!!!! @

?in8teather Tabycot !5!15! H!!! !

< #olphin Tabycot 1N5!5! N@!! !

> #ecent OfficeCable !15!15! @!!! <!

@. Uomfort3one #oubleTed 15!15! @!!! @

F #onald Tabycot >5!5! F@!! 1@

H oyal*inish OfficeCable !5!5! 1I!!! <!

I oyaltiger Bofa 5!5! <1!!! <!

N cono sittingBofa 1<515!1 N@!! @

1! ating?aradise #iningCable 1N5!5! 11@!! @

Cable : A&VAGB

 9O. &C69A6 CW? #ACO*BCOUZ ?&U #&BUOD9C

11 oodUomfort #oubleTed <5!<5!< @!!! @

1 Old*o( Bofa !5!5!< 1H!!! !

1< 6ic8y Tabycot 15!5!< H@!! 1@

! | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 44: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 44/47

$a%. Co list the &C69A6 which are priced at more than 1@!!! from the *D9&CD table.$b% Co list &C69A6 and CW? of those items) in which #ACO*BCOUZ is before

5!15! from the *D9&CD table in descending order of &C69A6.$c% Co display &C69A6 and #ACO*BCOUZ of those items) in which the #&BUOD9C

 percentage is more than @ from *D9&CD table.

$d% Co count the number of items) whose CW? is JBofaK from *D9&CD table.

$e% Live the output of fol1owing B]G statement: 9ote: Outputs of the below mentioned queries should be based on original data given in both the tables .

$i% Belect UOD9C$distinct CW?% from *D9&CD;$ii% Belect 6AX$#&BUOD9C% from *D9&CD) A&VAGB;

$iil% Belect AVL$#&BUOD9C% from *D9&CD where CW? / JTaby cotK ;

$iv% Belect BD6$?&U% from *D9&CD where #ACO*BCOUZ 7 {15!5!'

]F.. Liven the following LAB table) write B]G command for the questions $i% to $iii% and

give the output of $iv%.

LAB

N Ite#Na#e CstPerIte# Qua!tit( Date45ur'ase ?arra!t( O5erati!a+

1 Uomputer F!!!! N 15@5NF H

?rinter 1@!!! < 15@5NH >

< Bcanner 1I!!! 1 N5I5NI < 1

> Uamera 1!!! 1<51!5NF 1 1

@ Bwitch I!!! 1 <151!5NN 1

F D?B @!!! @ 15@5NF 1 >

H outer @!!! 11515!!! @

$i% Co select the &tem9ame)which are within the arranty period till present date.

$ii% Co display all the item9ame whose name starts with +U,.

$iii% Co list the &tem9ame in ascending order of the date of purchase here quantity is more than <.

$iv% Live the output of the following B]G commands:

$a% select min$#&BC&9UC ]uantity% from GAT;

$b% select ma($arranty% from GAT;

$U% select sum$Uost?er&tem% from Gab;

]H. Ta,+e & S'+Bus

tno Area_overed Uapacity 9oofstudents #istance Cransporter Uharges

1 Vasant8unE 1!! 1! 1! Bhivamtravels 1!!!!!

au3Zhas I! I! 1! Anandtravels I@!!!< ?itampura F! @@ <! Anandtravels F!!!!

> ohini 1!! N! <@ Anandtravels 1!!!!!

@ WamunaVihar @! F! ! ThallaUo. @@!!!

F Zrishna9agar H! I! <! WadavUo. I!!!!

H Vasundhara 1!! 11! ! WadavUo. 1!!!!!

I ?aschimVihar >! >! ! Bpeedtravels @@!!!

N Ba8et 1! 1! 1! Bpeedtravels 1!!!!!

1! Yana8?uri 1!! 1!! ! ZisanCours N@!!!

$a% Co show all information of students where capacity is more than the no of student in order 

of rtno.

$b% Co show area_covered for buses covering more than ! 8m.) but charges less then I!!!!.

$c% Co show transporter wise total no. of students traveling.$d% Co show rtno) area_covered and average cost per student for all routes where average cost per student is P

charges5noofstudents.

$e% Add a new record with following data:

$11) + 6oti bagh,)<@)<)1!), 8isan tours +) <@!!!%

$f% Live the output considering the original relation as given:

$i% select sum$distance% from schoolbus where transporter/ + Wadav travels,;

$ii% select min$noofstudents% from schoolbus;

$iii% select avg$charges% from schoolbus where transporter/ + Anand travels,;

$v% select distinct transporter from schoolbus;

!! | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 45: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 45/47

]I. TABLE & GRADUATE

S=NO NAME STIPEND SUB>ECT AERAGE DI=

1 ZAA9 >!! ?WB&UB FI &

#&AZA >@! UO6?. Bc FI &

< #&VWA <!! U6&BCW F &

> ZA <@! ?WB&UB F< &

@ AYD9 @!! 6ACB H! &

F BAT&9A >!! U6&BCW @@ &&

H YO9 @! ?WB&UB F> &I OTC >@! 6ACB FI &

N DT&9A @!! UO6?. Bc. F &

1! V&ZAB >!! 6ACB @H &&

/a0 Gist the names of those students who have obtained #&V 1 sorted by 9A6./,0 #isplay a report) listing 9A6) BC&?9#) BDTYUC and amount of stipend

received in a year assuming that the BC&?9# is paid every month.

/'0 Co count the number of students who are either ?WB&UB or UO6?DC BU

graduates.

/*0 Co insert a new row in the LA#DAC table:

11),ZAYOG,) <!!) +computer sc,) H@) 1/e0 Live the output of following sql statement based on table LA#DAC:

i. Belect 6&9$AVAL% from LA#DAC where BDTYUC/,?WB&UB,;ii. Belect BD6$BC&?9#% from LA#DAC div/;

iii. Belect AVL$BC&?9#% from LA#DAC where AVALR/F@;iv. Belect UOD9C$distinct BDT#YUC% from LA#DAC;

Assume that there is one more table LD&# in the database as shown below:

Ta,+e& GUIDE

"0 hat will be the output of the following query:BGUC 9A6) A#V&BO *O6 LA#DAC)LD&# BDTYUC/

6A&9AA;

MAINAREA ADISOR  

?WB&UB V&9O#

UO6?DC BU AGOZ  U6&BCW AYA9

6AC6AC&UB 6AB

11. rite B]G command for $a% to $g% on the basis of the table B?OCB

Btudent9O Ulass 9ame Lame1 Lrade Lame Lrade

1! H Bammer Uric8et T Bwimming A

11 I BuEit Cennis A B8ating U

1 H Zamal Bwimming T *ootball T

1< H Venna Cennis U Cennis A

1> N Archana Tas8etball A Uric8et A

1@ 1! Arpit Uric8et A Atheletics U

$a% #isplay the names of the students who have grade JUK in either Lame1 or Lameor both.

$b% #isplay the number of students getting grade JAK in Uric8et.$c% #isplay the names of the students who have same game for both Lame1 and

Lame.$d% #isplay the games ta8en up by the students) whose name starts with JAK.

$e% Assign a value !! for 6ar8s for all those who are getting grade JTK or grade JAK

n both Lame1 and Lame.

$f% Arrange the whole table in the alphabetical order of 9ame./"0 Add a new column named J6ar8sK.

!" | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 46: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 46/47

1. E#5+(ees

E#5i* irst!a#e Last!a#e A**ress Cit(

!1! avi Zumar aEnagar LT

1!@ arry altor Landhinagar LT

1@ Bam Cones <<lmBt. ?aris

1@ Barah Ac8erman >>!D.B.11! Dpton

>> 6anila Bengupta >*riendsstreet 9ew#elhi

<!! obert Bamuel N*ifth Uross ashington

<<@ itu Condon Bhastri9agar LT

>!! achel Gee 11arrisonBt. 9ewWor8  >>1 ?eter Chompson 11edoad ?aris

E#5Sa+ar(

E#5i* Sa+ar( Be!e4its Desi"!ati!

!1! H@!!! 1@!!! 6anager  

1!@ F@!!! 1@!!! 6anager  

1@ I!!!! @!!! #irector  

1@ H@!!! 1@!! 6anager  

>> @!!!! 1!!! Uler8  

<!! >@!!! 1!!!! Uler8  

<<@ >!!!! 1!!!! Uler8  

>!! <!!! H@!! Balesman

>>1 I!!! H@!! salesmanrite the B]G commands for the following :

$i% Co show firstname)lastname)address and city of all employees living in paris

$ii% Co display the content of mployees table in descending order of *irstname.

$iii% Co display the firstname)lastname and total salary of all managers from the tables

mployee and empsalary ) where total salary is calculated as salary4benefits.

$iv% Co display the ma(imum salary among managers and cler8s from the table mpsalary.

$v% Live the Output of following B]G commands:

$i% Belect firstname)salary from employees )empsalary where designation / JBalesmanKand

mployees.empid/mpsalary.empid;

$ii% Belect count$distinct designation% from empsalary;

$iii% Belect designation) sum$salary% from empsalary group by designation having count$2% R;

$iv% Belect sum$benefits% from empsalary where designation /KUler8K;

1< rite B]G commands for the following ta8ing in view the following table as BUOOG: 9o. 9ame Age #epartment Be(

1 An8it >@ Uomp.Bc. 6

Bumit < istory 6

< Amit Leog 6

> Buchitra < 6aths *

@ An8ita indi *

F Bhruti 1 Uomp.Bc. *

H a8sha indi *

I ?riya << 6aths *

 b. Co show all information about the members of the indi #epartment.

c. Co list the names of female members who are in indi department.d. Co list names of all members with the ascending order of their ages.

e. Co display member,s name) age and department name of males.

f. Co count the number of members with age R1.

g. Co insert a new row in the BUOOG table with the following data :N) +?into,)<1),6aths,),6,

h. Live the output of the following) considering the above table :a. BGUC UOD9C $#&BC&9UC AL% *O6 BUOOG;

 b. BGUC 6AX$AL% *O6 BUOOG BX / +6,;

c. BGUC AVL$AL% *O6 BUOOG BX /,6,;

!# | P a g e Q u e s t i o n B a n k - C o m p u t e r S c i e n c e | M s . C h a n d n i A g a r w a l

Page 47: Question Bank Xii

7/21/2019 Question Bank Xii

http://slidepdf.com/reader/full/question-bank-xii-56e106ef5cb1c 47/47

d. BGUC BD6$AL% *O6 BUOOG BX/,6,;1>. rite B]G command for $a% to $g% on the basis of the table LA6B

Ta,+e& GAMES

LUode Lame 9ame 9umber ?ri3e6oney Bchedule#ate

1!1 Uarom Toard @!!! <PYanP!!>

1! Tadminton 1!!! 1P#ecP!!<

1!< Cable Cennis > I!!! 1>P*ebP!!>

1!@ Uhess N!!! !1PYanP!!>

1!I Gawn Cennis > @!!! 1NP6arP!!>

Ta,+e& PLAER 

?code 9ame LUode

1 9abi Ahmed 1!1

avi Bahai 1!I

< Yatin 1!1

> 9a3neen 1!<

$a% Co #isplay the details of all games with their codes.$b% Co display details of those games which are having ?ri3e6oney more than H!!!.

$c% Co display the content of LA6B table in ascending order of Bchedule#ate.

$d% CO #isplay sum of ?ri3e6oney for each of the number of participation grouping$as shown in column number <.$e% BGUC UOD9C $#&BC&9UC 9umber% *O6 LA6B;

$f% BGUC 6AX $Bchedule#ate%) 6&9 $Bchedule#ate% *O6 LA6B;$g% BGU BD6 $?ri3e6oney% *O6 LA6B;

$h% BGUC #&BC&9U Lcode *O6 ?GAW;