Answer the question after going through the following class. Write the statements in main to invoke function1 and function2?
Advertisements
Question
Answer the question after going through the following class.
class Book {
int BookCode ; char Bookname[20];float fees;
public:
Book( ) //Function 1
{ fees=1000;
BookCode=1;
strcpy(Bookname,"C++"); }
void display(float C) //Function 2
{ cout<<BookCode<<":"<<Bookname<<":"<<fees<<endl; }
~Book( ) //Function 3
{ cout<<"End of Book Object"<<endl; }
Book (intSC,char S[ ],float F) ; //Function 4
};
Write the statements in main to invoke function1 and function2?
One Line Answer
Advertisements
Solution
book b;
b.display (4.5);
shaalaa.com
Is there an error in this question or solution?
Chapter 15: Polymorphism - Evaluation - Section - D [Page 258]
