Certain inputs

I am trying to grab inputs for time of day and day of week.
Time of day needs to be in 24 hour format, ex: 1:30 is 13:30 and day of week needs to be the first 2 letters, ex: Mo, Tu, We, etc. What variable types should I use for 24 hour format & how do I use char with multiple letters?

And then how would i use a loop to tell when the time is in a certain range, from like 9:00 to 18:30?
This is my code so far, obviously it doesnt work, but it's supposed to calculate cost of a long distance phone call. M-F 8am-6pm is 40 cents/min, otherwise 25 cents/min and weekends are only 15 cents/min at all times..

int _tmain(int argc, _TCHAR* argv[])
{
	char dayOfWeek, repeat;
	int lengthOfCall;
	double timeOfDay, costOfCall;
	do{
		cout << "Input the day of the week (ex: Mo is Monday): ";
		cin >> dayOfWeek;
		cout << "Input the time the call starts in 24 hour format (1:30 = 13:30): ";
		cin >> timeOfDay;
		cout << "Input the length of call in minutes: ";
		cin >> lengthOfCall;

		if(dayOfWeek == 'Mo' || dayOfWeek == 'Tu' || dayOfWeek == 'We' || dayOfWeek == 'Th' || dayOfWeek == 'Fr'){
			if(timeOfDay > 8:00 && timeOfDay < 18:00){
				costOfCall = lengthOfCall * .4;
			}
			else if(timeOfDay < 8:00 && (timeOfDay > 18:00 && timeOfDay < 24:00)){
				costOfCall = lengthOfCall * .25;
			}
			else{
				cout << "You have not entered a valid time of day." << endl;
			}
		}
		else if(dayOfWeek == 'Sa' || dayOfWeek == 'Su'){
			costOfCall = lengthOfCall * .15;
		}
		else{
			cout << "You have not entered a valid day of the week." << endl;
		}

		cout << "The cost of your call will be: " << costOfCall << endl;
		cout << "Do you want to repeat this program? (enter Y or y): ";
		cin >> repeat;
	}while(repeat == 'Y' || repeat == 'y');

	return 0;
}
Topic archived. No new replies allowed.