I need some help with a program I'm working on, I have to calculate the cost of a long distance phone call based on the day, time and length of the call. This is what I have so far. I need to figure out how to test what day they are entering and the day is written like this - Mo, Tu, We, Th etc.
#include <iostream.h>
using namespace std;
int main()
{
char M[256], day[256];
cout << "Enter the day you have made your call (enter as Mo, Tu, We, Th, Fr, Sa or Su) "
<< " the time (in 24 hour notation) the call started and the length of the call." << endl;
cin.getline (day,256);
cout << day;
if (day == "Mo")
{
cout << endl << "Monday" << endl;
}
else
cout << "fail";
system("pause");
return 0;
}
So right now it fails because it can't check whether the day is Monday.