i went thru your program, none of your error are serious,
they are mostly misplaced or missing ';' in visual studio, just
read the error and double click it and it will take you to the
line with the error, and just notice what you did wrong and fix it.
oh btw, after a if / else / if else / while / for / switch and serveral
other things you dont need a semi colon after the partheses, just
the brackets { } .
Code:
else if ( temp > 99 ),( temp < 200 ); {
cout<<"The potato will be semi cooked \n";
}
should look like this
Code:
else if ( temp > 99 && temp < 200 )
{
cout<<"The potato will be semi cooked \n";
}
This is your finalized code with a little better indentations, well in my opinion, with the changes made, i recommend you go thru the code and correct the stuff yourself, but if your still having problems here ya go :
Code:
#include <iostream>
using namespace std;
int main ()
{
int a,input,temp;
int x = 1;
while ( x != 1000000 )
{
cout<<"This is my game !! \n";
cout<<"Ok you have a potato. WOOT! What will you do with it? \n";
cout<<"1) cook the potato \n";
cout<<"2) Use the potato as a pilow and take a nap \n";
cout<<"3) Try to become president? \n";
cin>> input;
switch ( input )
{
case 1:
cout<<"For how long? /n";
cin>> temp;
if ( temp < 100 )
{
cout<<"potato is stall \n";
}
else if ( temp > 99 && temp < 200 )
{
cout<<"The potato will be semi cooked \n";
}
else if ( temp > 199 && temp < 300 )
{
cout<<"the potato is cooked well \n";
}
else if ( temp > 299 && temp < 500 ) {
cout<<"the potato was bernt \n";
}
else if ( temp > 499 )
{
cout<<"your house is on fire!! \n" <<"1) call 911 \n" <<"2) leave. \n" <<"3) stay in bulding";
cin >> input;
switch ( input )
{
case 1:
cout<<"Thay save your house steal you good stuff and charg you money for it!?!? \n";
break;
case 2:
cout<<"you get away, than are found and put in jail for arson";
break;
case 3:
cout<<"You die WOOT";
break;
}
}
break;
case 2:
cout<<"You don't think this is a good idea.. \n";
cout<<"Zzzzz Zzzzzz \n";
cout<<"Your back is killing you do you go to the hospital? \n";
cout<<"1) Yes \n";
cout<<"2) No \n";
cin>> input;
switch ( input )
{
case 1:
cout<<"The hospital charges you $50,000 \n";
break;
case 2:
cout<<"Your back make you lose consentration and you fall in a manhole and die!! \n";
cout<<"HAHAHAHAHAHA";
break;
default:
cout<<"ERROR bad choise bye";
break;
}
case 3:
cout<<"Ppl really vote for you so you have to make a platform (statment) \n";
cout<<"1) i want candy \n";
cout<<"2) Guns for all \n";
cout<<"3) I decline! \n";
cin>> input;
switch ( input )
{
case 1:
cout<<"You get fired";
break;
case 2:
cout<<"you become the next president and get assasinated";
break;
case 3:
cout<<"Ppl are disipointed in you";
break;
default:
cout<<"ERROR bad choise bye";
break;
}
}
cout<<"more? \n";
cout<<"1) yes \n";
cout<<" 2) no";
cin>> a;
switch ( a )
{
case 1:
break;
case 2:
int x = 1000000;
break;
}
}
cin.get();
}