Warning: include_once(../../../headder.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/computer_science1/calss_object3.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_science1/calss_object3.php on line 16

CBSE Computer Science - Revision Tour(Solved)

CBSE Guess > eBooks > Class XII > CBSE Computer Science Class And Object Solved Revision Tour By Mr. Ravi Kiran

COMPUTER SCIENCE CLASS AND OBJECTS


Warning: include(../../../ads_330x250_middle.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/computer_science1/calss_object3.php on line 23

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_science1/calss_object3.php on line 23

Previous Index Next

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

Private Members:

REG_NO    integer(Ranges 10-1000)
NAME          Array of characters(String)
TYPE          Character
COST          Float

Public Members:

Function Read_Data( ) to rread an object of HOUSING type.
Function Display( ) to display the details of an object.
Function Draw_Nos( ) to choose and displaym the details of 2 houses selected randomly from an array of 10 objects of type HOUSING. Use random function to generate the registration nos. to match with REG_NO from the array.

4

Ans:

class HOUSING
{ int REG_NO;
char NAME[31];
char TYPE;
float COST;
public:
void Read_Data( )
{ cout<<"\nEnter the House Registration Number: ";
cin>>REG_NO;
cout<<"\nEnter the House Name: ";
gets(NAME);
cout<<"\nEnter the House Type: ";cin>>TYPE;
cout<<"\nEnter the House Cost: ";
cin>>COST;
}
void Display()
{ cout<<"\nThe Registration Number of the
House: "<<REG_NO;
cout<<"\nThe name of the House: “ <<NAME;
cout<<"\nThe Type of the House: "<<TYPE;
cout<<"\nThe Cost of the House: "<<COST;
}
void Draw_Nos();
};
void HOUSING::Draw_Nos( )
{ //Dear Students, a test for you. Completethis member function.
}

 

Previous Index Next

CBSE Computer Science Solved Revision Tour By Mr. Ravi Kiran ( [email protected] )



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

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_science1/calss_object3.php on line 79