//Engr. Ahmad Furqan Attari
//Chapter 6, Problem 5
#include <iostream>
#include <conio.h>
using namespace std;
class date
{
private:
int day,month,year;
public:
void getdate(void)
{
char ch;
cout<<"Enter data in the format mm/dd/yyyy : ";
cin>>month>>ch>>day>>ch>>year;
}
void showdate(void)
{
cout<<month<<"/"<<day<<"/"<<year;
}
};
void main(void)
{
date today;
today.getdate();
cout<<"The date you entered is "<<endl;
today.showdate();
getch();
}
//Chapter 6, Problem 5
#include <iostream>
#include <conio.h>
using namespace std;
class date
{
private:
int day,month,year;
public:
void getdate(void)
{
char ch;
cout<<"Enter data in the format mm/dd/yyyy : ";
cin>>month>>ch>>day>>ch>>year;
}
void showdate(void)
{
cout<<month<<"/"<<day<<"/"<<year;
}
};
void main(void)
{
date today;
today.getdate();
cout<<"The date you entered is "<<endl;
today.showdate();
getch();
}
Sir thnku
ReplyDelete