I am attempting to take a meeting start and stop time, add an hour to the beginning and the end(autoScaling), convert those times from a user picked time zone (either et, ct, mt, or pt) to UTC, Then converting those two times to military time. and including a choice for daylight savings time or standard time
** It freezes when I get to the switch case ??????
// Assigning the Variables
int startTime;
int endTime;
char amOrPmStart;
char amOrPmStop;
int timezone;
char seasonal;
double autoScalingStart;
double autoScalingStop;
double meetingLength;
int main ()
{
// Input Daylight Savings Time or Standard Time
cout << "Enter 'd' for Daylight Savings Time or 's' for Standard Time." << endl <<
"Note: In 2020, Daylight Saving Time ends Sunday Nov 1:" << endl;
cin >> seasonal;
// Input Event Start Time and Time Zone
cout << "Enter the time the Townhall Event Starts:" << endl;
cin >> startTime;
cout << endl;
// Validate
while (startTime > 12)
{
cout << "Enter a valid start time:" <<endl;
cin >> startTime;
cout << endl;
}
cout << "Enter 'a' for am or 'p'for pm:" << endl;
cin >> amOrPmStart;
cout << endl;
cout << "Enter the Event timezone using '1' for eastern, '2' for central, '3' for mountain or '4' for pacific:" << endl;
cin >> timezone;
cout << endl;
//Validate
while (timezone != 1 && timezone != 2 && timezone != 3 && timezone != 4)
{
cout << "Enter a valid timezone either '1', '2', '3', or '4': " << endl;
cin >> timezone;
cout << endl;
}
/////////////////////////////////////////////////////
// Calculating the Autoscaling start and stop time//
///////////////////////////////////////////////////
switch(timezone){
case 1:
if (startTime == 12)
{
if (amOrPmStart == 'p')
{
startTime = (startTime - 12);
}
else if (amOrPmStart == 'a')
{
startTime = (startTime + 12);
}
}
autoScalingStart = startTime + 3;
if (amOrPmStart == 'p')
{
autoScalingStart = (autoScalingStart + 12);
}
while (seasonal == 's')
{
autoScalingStart = (autoScalingStart + 1);
}
cout << "The autoscaling start time is " ;
cout << autoScalingStart << ":00" << endl;
autoScalingStop = (autoScalingStart + meetingLength + 2);
cout << "The autoscaling stop time is ";
cout << autoScalingStop << ":00" << endl;
break;
case 2:
if (startTime == 12)
{
if (amOrPmStart == 'p')
{
startTime = (startTime - 12);
}
else if (amOrPmStart == 'a')
{
startTime = (startTime + 12);
}
}
autoScalingStart = startTime + 4;
if (amOrPmStart == 'p')
{
autoScalingStart = (autoScalingStart + 12);
}
while (seasonal == 's')
{
autoScalingStart = (autoScalingStart + 1);
}
cout << "The autoscaling start time is ";
cout << autoScalingStart << ":00" << endl;
autoScalingStop = (autoScalingStart + meetingLength + 2);
cout << "The autoscaling stop time is ";
cout << autoScalingStop << ":00" << endl;
break;
case 3:
if (startTime == 12)
{
if (amOrPmStart == 'p')
{
startTime = (startTime - 12);
}
else if (amOrPmStart == 'a')
{
startTime = (startTime + 12);
}
}
autoScalingStart = startTime + 5;
if (amOrPmStart == 'p')
{
autoScalingStart = (autoScalingStart + 12);
}
while (seasonal == 's')
{
autoScalingStart = (autoScalingStart + 1);
}
cout << "The autoscaling start time is ";
cout << autoScalingStart << ":00" << endl;
autoScalingStop = (autoScalingStart + meetingLength + 2);
cout << "The autoscaling stop time is ";
cout << autoScalingStop << ":00" << endl;
break;
case 4:
if (startTime == 12)
{
if (amOrPmStart == 'p')
{
startTime = (startTime - 12);
}
else if (amOrPmStart == 'a')
{
startTime = (startTime + 12);
}
}
autoScalingStart = startTime + 6;
if (amOrPmStart == 'p')
{
autoScalingStart = (autoScalingStart + 12);
}
while (seasonal == 's')
{
autoScalingStart = (autoScalingStart + 1);
}
cout << "The autoscaling start time is ";
cout << autoScalingStart << ":00" << endl;
autoScalingStop = (autoScalingStart + meetingLength + 2);
cout << "The autoscaling stop time is ";
cout << autoScalingStop << ":00" << endl;
break;