Hi guys
where is the problem with that simple class program:
#include<iostream>
#include<conio.h>
using namespace std;
class DayOfYear
{
public:
DayOfYear(int month,int day);
void output();
void input();
private:
int month_year;
int day_year;
};
DayOfYear::DayOfYear(int month,int day)
{
month_year=month;
day_year=day;
}
void DayOfYear::output()
{
cout<<month_year<<"/"<<day_year;
}
void DayOfYear::input()
{
cout<<"What's your month of birthday : ";
cin>>month_year;
cout<<"What's your day of birthday : ";
cin>>day_year;
}
int main()
{
cout<<"The program will use class and a regular function and represent some kind of connection between them"<<endl;
DayOfYear bach_birthday(3,21),my_birthday;
cout<<"The birth of Bach is : ";
bach_birthday.output();
cout<<"\nNow I will ask you about your birthday"<<endl;
cout<<"What is your month and day of birthday : ";
my_birthday.input();
my_birthday.output();
getch();
return 0;
}