1.

Modify the program 2 of Type C to include constructors for the three classes.

Answer»

class Account

{

public Account()

{   strcpy(name,"NULL"); ano=0; balance=0.0; }

// same as above

};

class Current public Account

{   public Current()

{   depo=0.0;with=0.0;pen=0.0; }

// same as above

};

class Savings:public

Account 

{

public Savings()

{ depo=0.0;with=0.0;intr=0.0; }

// same as above

};

void main()

{  // same as above

}



Discussion

No Comment Found

Related InterviewSolutions