#include <iostream>
using namespace std;
class birthday
{
public:
//add default constructor
birthday() = default;
birthday(int d,int m,int y)
{
date=d;
month=m;
year=y;
}
void printdate()
{
cout<<date<<"/"<<month<<"/"<<year<<endl;
}
private:
//using in class initializers give some default values to the data members according to your needs
int date = 0;
int month =0;
int year = 0;
};
class person
{
public:
person(string x)
{
name=x;
}
void printname()
{
cout<< "the birthday person is "<< name << " whose birthday is on ";
day.printdate();//moved this out of the cout because printdat() does not return anything
}
private:
birthday day;
string name;
};
int main()
{
birthday b(10,11,2007);
person p("Jessica");
p.printname();
return 0;
}