English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

Answer the question after going through the following class. Write the definition for Function4.

Advertisements
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 definition for Function4.

Short/Brief Note
Advertisements

Solution

Book: :Book (int sc.char.s[], float, F) // Function 4
{
Book Code = SC
strcpy (Book name, S);
fees = F;
}

shaalaa.com
  Is there an error in this question or solution?
Chapter 15: Polymorphism - Evaluation - Section - D [Page 258]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 15 Polymorphism
Evaluation - Section - D | Q 2. (v) | Page 258
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×