Page 336 - C++
P. 336
(i) Write the type of the inheritance illustrated in the above.
(ii) Find and write the output of the above code.
(iii) What are the methods shown in Line 1, Line 3 and Line 5
known as ?
(iv) What is the difference between the statements shown in
Line 6 and Line 7 ?
3. (a) Consider the following randomly ordered numbers stored in a list : 3
786, 234, 526, 132, 345, 467
Show the content of the list after the First, Second and Third
pass of the bubble sort method used for arranging in ascending
order ?
Note : Show the status of all the elements after each pass very
clearly underlining the changes.
(b) Write the definition of a method ZeroEnding(SCORES) to add all
those values in the list of SCORES, which are ending with zero (0)
and display the sum. 3
For example :
If the SCORES contain [200, 456, 300, 100, 234, 678]
The sum should be displayed as 600
(c) Write AddClient(Client) and DeleteClient(Client) methods in Python
to add a new Client and delete a Client from a List of Client Names,
considering them to act as insert and delete operations of the queue
data structure. 4
(d) Write a definition of a method COUNTNOW(PLACES) to find and
display those place names, in which there are more than 5
characters. 2
For example :
If the list PLACES contains
["DELHI","LONDON","PARIS","NEW YORK","DUBAI"]
The following should get displayed :
LONDON
NEW YORK
(e) Evaluate the following Postfix notation of expression : 2
22,11,/,5,10,*,+,12,
91 17 P.T.O.