.Start with the date structure in Task 3 and transform it into a date class. Its member data should consist of three ints: month, day, and year. It should also have two member functions: getdate(), which allows the user to enter a date in12/31/02 format, and showdate(), which displays the date
4.Start with the date structure in Task 3 and transform it into a date
class. Its member data should consist of three ints: month, day, and year. It should also have two member functions: getdate(), which allows the user to enter a date in12/31/02 format, and showdate(), which displays the date
-----------------------------------------------------------------------------------here is my output as shown below for the task 3 can you please help
#include <iostream>
using namespace std;
struct date
{
int day;
int month;
int year;
}obj;
int main()
{
cout<<"Enter day :";
cin>>obj.day;
cout<<"Enter month :";
cin>>obj.month;
cout<<"Enter year :";
cin>>obj.year;
cout<<"Enter date is :"<<obj.day<<"/"<<obj.month<<"/"<<obj.year;
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images