Warning: include_once(../../../headder.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/computer_science/chapter4_b.php on line 16

Warning: include_once(): Failed opening '../../../headder.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/computer_science/chapter4_b.php on line 16

CBSE eBooks

CBSE Guess > eBooks > Class XII > Computer Science By . Mr. MRK

Chapter – 4. CLASSES AND OBJECTS

Previous Index Next


Warning: include(../../../ads_330x250_middle.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/computer_science/chapter4_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/chapter4_b.php on line 26

2006 Delhi:

2.c. Define a class named ADMISSION in C++ with the following descriptions:

Private Members:

AD_NO integer(Ranges 10 – 2000)
NAME Array of characters(String)
CLASS Character
FEES Float

Public Members: Function Read_Data( ) to read an object of ADMISSION type. Function Display( ) to display the details of an object. Function Draw-Nos.( ) to choose 2 students randomly. And display the details. Use random function to generate admission nos. to match with AD_NO.

Ans:

class ADMISSION
{
int AD_NO;
char NAME[31];
char CLASS;
float FEES;
public: void Read_Data( )
{
cout<<"\nEnter the Admission Number: ";
cin>>AD_NO;
cout<<"\nEnter the Student Name: ";
gets(NAME);
cout<<"\nEnter the Class: ";
cin>>CLASS; cout<<"\nEnter the Fees: ";
cin>>FEES; } void Display()
{
cout<<"\nThe Admission Number of the student: "<<AD_NO;
cout<<"\nThe name of the Student: "<<NAME;
cout<<"\nThe Class of the Student: "<<CLASS;
cout<<"\nThe Fees of the Student: "<<FEES;
} void Draw_Nos();
};
void ADMISSION::Draw_Nos( )
{
//Dear Students, a test for you. Complete this member function.
}

2006 Outside Delhi:

1.b. Illustrate the use of Inline function in C++ with the help of an example. 2

Ans: INLINE FUNCTIONS: The inline functions are a C++ enhancement designed to speed up programs. The coding of normal functions and inline functions is similar except that inline functions definitions start with the keyword inline.

Previous Index Next


Warning: include(../../../120_60_others.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/computer_science/chapter4_b.php on line 83

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/chapter4_b.php on line 83