CBSE eBooks CBSE Guess > eBooks > Class XII > Computer Science By . Mr. MRK
Chapter – 5. CONSTRUCTORS & DESTRUCTORS Warning: include(../../../ads_330x250_middle.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/computer_science/chapter5_b.php on line 26 Warning: include(): Failed opening '../../../ads_330x250_middle.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/computer_science/chapter5_b.php on line 26 OUTSIDE DELHI 2008 2.b. Answer the questions (i) and (ii) after going through the following program: #include<iostream.h> (i) will statement 1 initialize all the data members for objects R with the given in the function 1 ? (YES OR NO). Justify your Answer suggesting the corrections(s) to be made in the above code. Ans: No. The reason is the constructor should be defined under the public visibility label. (ii) What shall be the possible out put when the program gets executed ? (Assuming, if required the suggested correction(s) are made in the program) Ans: Possible Output: cerial–Rice:100@25 2.c. Define a class clothing in c++ with the following descriptions : private members :
A function calc_price( ) which calculates and assigns the value of GPrice as follows ; For the value of material as “COTTON” :
for material other than “COTTON”, the above mentioned GPprice price gets reduced by 25% |
Warning: include(../../../120_60_others.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/computer_science/chapter5_b.php on line 101 Warning: include(): Failed opening '../../../120_60_others.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/computer_science/chapter5_b.php on line 101 |