Question: Consider the following class declaration ( Do not modify the class ) : class PersonType { public: PersonType ( ) ; PersonType ( string n

Consider the following class declaration (Do not modify the class) :
class PersonType
{
public:
PersonType();
PersonType(string n, int id, string bd);
private:
string
name; int
ID;
string birthday;
};
Explain what is wrong with the following code fragment and write code to correct it:
int main()
{
PersonType family[20],
newBaby("Anny Dube", 20180912,"2 Sept");
//Assume family has been
initialised for (int i =0;
i 20; i++)
if (family.birthday[5]== newBaby.birthday)
cout
family.name[5]" share a birthday with "
newBaby.name;
return 0;
}
Consider the following class declaration ( Do not

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!