Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 01-19-2004, 12:30 AM   #1
Member (4 bit)
 
Join Date: Jan 2004
Location: Barrie
Posts: 8
C++. Unepected End of File Found

WHAT DOES THIS MEAN, CAN SOMEONE PLEASE HELP!
troublewithc++ is offline   Reply With Quote
Old 01-19-2004, 08:28 AM   #2
aym
Registered User
 
aym's Avatar
 
Join Date: Nov 2001
Posts: 1,965
most probably you missed a closing brace, or added an extra one.
If you still can't find what's wrong, post your code and we'll try to help.
And please don't type all caps again.
good luck.
aym is offline   Reply With Quote
Old 01-19-2004, 10:46 AM   #3
Member (4 bit)
 
Join Date: Jan 2004
Location: Barrie
Posts: 8
# include
void main (void)
{

int purchase1=0,purchase2=0, purchase3=0, purchase4=0, purchase5=0, purchase6=0,
purchase7=0, purchase8=0,purchase9=0,purchase10=0;
char start[100];
int total=0;
int add_array;
int array[200];
int size;
int i;

{ int i;
int total = 0;

for(i = 0; i < size; i++)
total += array[i];

printf(" Welcome To Zero Donkey Your #1 Snow Boarding Store\n");
printf(" After You Have Selected Your Items, Type End For Your Final Price\n");
printf(" Please Type Start To Begin\n");
scanf("%s",&start);
printf("\n");

printf("Item #1-Zero Donkey Goggles $10.00\n");
printf("Purchase Item? 1. Yes Or 2 .No? 1 or 2\n");
scanf("%i",&purchase1);

if (purchase1==1){
total+=10;
}
printf("\n");

printf("Item #2- Zero Donkey Outerwear Jacket $100.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase2);

if (purchase2==1){
total+=100;
}
printf("\n");

printf("Item #3- Zero Donkey Series 200 Snowboard $285.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase3);

if (purchase3==1){
total+=285;
}
printf("\n");

printf("Item #4- Dream Leap Bindings $30.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase4);

if (purchase4==1){
total+=30;
}
printf("\n");

printf("Item #5- Zero Donkey Boots $35.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase5);

if (purchase5==1){
total+=35;
}
printf("\n");

printf("Item #6- Dream Leap Helmet $20.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase6);

if (purchase6==1){
total+=20;
}
printf("\n");

printf("Item #7- Zero Donkey Ski-Pass (Zero Dream Snow Resort) $80.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase7);

if (purchase7==1){
total+=80;
}
printf("\n");

printf("Item #8- Dream Leap Sunglasses $8.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase8);

if (purchase8==1){
total+=8;
}
printf("\n");
printf("Item #9- Zero Donkey Snowboard Video $ 15.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase9);
if (purchase9==1){
total+=15;
}
printf("\n");
printf("Item #10- Zero Donkey Key Chain $4.00\n");
printf("Purchase Item? Yes Or No?\n");
scanf("%i",&purchase10);
if (purchase10==1){
total+=4;
}
printf("\n");


{
return;(total);

printf("Your total today is: $%i \n",total );
scanf("%i",total);

}






still one error -unexpected end of file found. i dont even think that hte stuipd array i tried to put in worked.
troublewithc++ is offline   Reply With Quote
Old 01-19-2004, 07:54 PM   #4
Member (9 bit)
 
Join Date: May 1999
Location: kitchener, Ontario
Posts: 364
there are many uneccessary brackets

it would also help make your code more readable to write one command per line and indent relevant blocks of code.

oh.. and theres nothing after the include statement. there should probably be an 'stdio.h' there or none of the print and scan finctions will work
rios__ is offline   Reply With Quote
Old 01-27-2004, 01:46 PM   #5
sym
Member (7 bit)
 
Join Date: Nov 2001
Location: Rochester, NY
Posts: 87
Looking at the code, it looks like you are missing two "}" at the end.
sym is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:45 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2