HEEEEELP!!!
I see no error in our source code, but the Borland saw my error I didn't see!!!
void P_TRIANGLE(void) //PERIMETER TRIANGLE
{
float S1, S2, S3, Pt;
char ans;
textcolor(WHITE);
textbackground(LIGHTGREEN);
gotoxy(10,8); cprintf("Side 1 = ");
cin>>S1;
gotoxy(10,9); cprintf("Side 2 = ");
cin>>S2;
gotoxy(10,10); cprintf("Side 3 = ");
cin>>S3;
Pt = S1 + S2 + S3;
gotoxy(10,12); cprintf("The Perimeter is = ");
cout<<Pt;
gotoxy(10,14); cout<<Pt; cprintf("="); cout<<S1; cprintf("+"); cout<<S2; cprintf("+"); cout<<S3; cprintf("+");
gotoxy(10,16); cprintf("Back to:");
gotoxy(10,17); cprintf("[P]erimeter Menu");
gotoxy(10,18); cprintf("[M]ain Menu");
gotoxy(10,19); cprintf("[E]xit");
cin>>ans;
if(ans == 'P' || ans == 'p')
{
clrscr();
PERIMETER();
getch();
}
else if(ans == 'M' || ans == 'm')
{
clrscr();
menu();
getch();
}
else(ans == 'E' || ans == 'e')
{//it says 'Statement missing ;"
gotoxy(15,8); cprintf("Sayonara! ^.^");
getch();
}
}
void P_SQUARE(void) //PERIMETER SQUARE
{//it says 'Declaration syntax error'
float Side, Ps;
char ans;
textcolor(WHITE);
textbackground(LIGHTGREEN);
gotoxy(10,8); cprintf("Side = ");
cin>>Side;
Ps= 4 * Side;
gotoxy(10,10); cprintf("The Perimeter is = ");
cout<<Ps;
gotoxy(10,12); cprintf("Back to:");
gotoxy(10,13); cprintf("[P]erimeter Menu");
gotoxy(10,14); cprintf("[M]ain Menu");
gotoxy(10,15); cprintf("[E]xit");
cin>>ans;
if(ans == 'P' || ans == 'p')
{
clrscr();
PERIMETER();
getch();
}
else if(ans == 'M' || ans == 'm')
{
clrscr();
menu();
getch();
}
else(ans == 'E' || ans == 'e')
{
clrscr();
gotoxy(15,8); cprintf("Sayonara! ^.^");
getch();
}
}
on the comment line it is where the error appears, but I opened and closed the function correctly....if you see my error please tell me...
everytime i tried to adjust the first error, it affects the other functions.......
Look at this line
else if(ans == 'M' || ans == 'm')
and then this line
else(ans == 'E' || ans == 'e')
and you should be able to see what's missing :-)
Last edited on
else(ans == 'E' || ans == 'e')
else
does not work like that. else
does not accept a logical condition. Change that else
to an else if
Edit: Moooce beat me to it. Part man, part cow, all programmer :p
Last edited on
GEE, THANK YOU SOOOOOO~~ MUCH, GUYS!!! THAT REALLY HELPED!! :D THANK YOU THANK YOU THANK YOU GUYS :D
~GOD BLESS YOU! :D