Hello all, I got a new problem to do in copmuter programming and I can't seem to figure out how to correct the error in my programming. In the program I will be given a zulu time(aja, Greenwich[England] mean time) and an indication of the US time zone I'm in. E will be Eastern-Standard, C for Central-Standard, M for Mountain-Standard time, and P for Pacific-Standard time. I'm supposed to produce the local standard time that would appear on a 12 hour clock for the indicated time zone and given zulu time. along with the appropriate a.m. or p.m. designation. Zulu time is a 24 hour clock from which I have to subtract either 500(eastern), 600(central), 700(mountain), or 800(pacific) from to find out the appropriate time for the zone. I have it started but there's an error saying that 'subscript requires array or pointer type'. Can anyone tell me what that means and how I can fix it please? here's the code:
#include<iostream.h>
int main()
{
int time=0;
cin>>time;
int zone=0;
cin>>zone;
for(int x=0; x<900; x++)
{
switch(zone[x])
{
case 'E': zone=500;
break;
case 'C': zone=600;
break;
case 'M': zone=700;
break;
case 'P': zone=800;
break;
default:
break;
}
}
return 0;
}
#include<iostream.h>
int main()
{
int time=0;
cin>>time;
int zone=0;
cin>>zone;
for(int x=0; x<900; x++)
{
switch(zone[x])
{
case 'E': zone=500;
break;
case 'C': zone=600;
break;
case 'M': zone=700;
break;
case 'P': zone=800;
break;
default:
break;
}
}
return 0;
}