I have this project due in an hour and needed some help if any of you can. I need it to accept input of any date in the form of MM/DD/YYYY, and convert it to:
Month, date, year. this is my code so far:
#include <iostream>
#include <iomanip>
using namespace std;
enum typeMonth {January = 1, February, March, April, May, June, July,
August, September, October, November, December};
int main(){
int MM, DD, YYYY;
cout << "This will converts your input of the date to a different format" << endl;
cout << "Enter a date: ";
cin >> MM;
cin.ignore(2, '/') << endl;
cin << DD;
cin.ignore(2, '/') << endl;
cin << YYYY << endl;
string xMonth;
cout << "The date you entered is MM/DD/YYYY";
return 0;
}
the part where it says "the date you have entered" is just to see if everything is working right, its not what i need
#include <iostream>
#include <iomanip>
using namespace std;
enum Month {JANUARY = 1, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY,
AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER};
int main(){
int MM, DD, YYYY;
cout << "This will convert your input of the date to a different format"
<< endl;
cout << "Enter a date: ";
cin >> MM;
cin.ignore(2, '/') << endl;
cin << DD;
cin.ignore(2, '/') << endl;
cin << YYYY << endl;
switch
return 0;
}
new code so far, i only have 45 minutes left, please help
#include <iostream>
#include <iomanip>
using namespace std;
enum Month {JANUARY = 1, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY,
AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER};
int main(){
int MM, DD, YYYY;
cout << "This will convert your input of the date to a different format"
<< endl;
cout << "Enter a date: ";
cin >> MM;
cin.ignore(2, '/') << endl;
cin << DD;
cin.ignore(2, '/') << endl;
cin << YYYY << endl;
string xMonth;
switch (Month){
Case 1 = January;
break;
Case 2 = February;
break;
Case 3 = March;
break;
Case 4 = April;
break;
Case 5 = May;
break;
Case 6 = June;
break;
Case 7 = July;
break;
Case 8 = August;
break;
Case 9 = September;
break;
Case 10 = October;
break;
Case 11 = November;
break;
Case 12 = December;
break;
default:
cout << "Wrong, there are only 12 months";
}