*MAFIA* Forums
*MAFIA* => Help => Topic started by: Partyboy on November 21, 2006, 07:32:26 PM
-
Okay im trying to follow this tut for the 2nd time. the first time i kept getting this error but today i tried again and got the same error. Whats wrong with it?
#include
using namespace std;
void main (void)
{
int UserAge = 0;
char Person = 'b';
cout << "What is your age?: ";
cin >> UsersAge:
if ((UsersAge >= 0) && (UsersAge <=4))
{
Person 'b';
}
else
{
if ((UsersAge >= 5) && (UsersAge <=20))
Person = 'y';
else
{
if ((UsersAge >= 21) && (UsersAge <=65))
Person = 'a';
else
{
if ((UsersAge >= 66) && (UsersAge <=135))
Person = 'o';
else
Person 'x';
}
}
}
if (Person == 'b')
{
cout << "Hi there, you are a baby- Becuase you are " << UsersAge << " years old" ;
}
else
{
if (Person == 'y')
cout << "Hi there, you are a teenager- Becuase you are " << UsersAge << " years old" ;
else
{
if (Person == 'a')
cout << "Hi there, you are a adult- Becuase you are " << UsersAge << " years old" ;
else
{
if (Person == 'o')
cout << "Hi there, you are an old person- Becuase you are " << UsersAge << " years old" ;
else
{
if (Person == 'x')
cout << "I think you are lying becuse you are not " << UsersAge << " years old" ;
}
}
}
}
}
-
Hmm lets see ah yes...
#include
using namespace std;
void main (void)
{
int UserAge = 0;
char Person = 'b';
cout << "What is your age?: ";
cin >> UsersAge:
if ((UsersAge >= 0) && (UsersAge <=4))
{
Person 'b';
}
else
{
if ((UsersAge >= 5) && (UsersAge <=20))
Person = 'y';
else
{
if ((UsersAge >= 21) && (UsersAge <=65))
Person = 'a';
else
{
if ((UsersAge >= 66) && (UsersAge <=135))
Person = 'o';
else
Person 'x';
}
}
}
if (Person == 'b')
{
cout << "Hi there, you are a baby- Becuase you are " << UsersAge << " years old" ;
}
else
{
if (Person == 'y')
cout << "Hi there, you are a teenager- Becuase you are " << UsersAge << " years old" ;
else
{
if (Person == 'a')
cout << "Hi there, you are a adult- Becuase you are " << UsersAge << " years old" ;
else
{
if (Person == 'o')
cout << "Hi there, you are an old person- Becuase you are " << UsersAge << " years old" ;
else
{
if (Person == 'x')
cout << "I think you are lying becuse you are not " << UsersAge << " years old" ;
}
}
}
}
}
Well you can always null instead of void, also you did not in-case the = value for each rule set
{
person blah
}
not to mention you are == on all the reference calls what are you double valuing? if (blah == 'a','b'); else {null}
I didnt carry the close because I wanted you to see a double value line.
Best of luck
-
Yay, finally something I understand lol. I used to get parse errors (kinda annoying if you have to fix them every time), they just make me freak out lol, so then I stopped doing C++.
Lol anyways, hmm goodluck with C++ party
-
c++ is almost like php. But you dont have to define every value and where it is like in php.
-
1 Error
c:\program files\microsoft visual studio\myprojects\project3\project3.cpp(64) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Pointing to the last closed curly bracket.
-
Did you make sure, you have the functions set, and the calls to those functions must be closed.
If you have a space after the close it will cause a loop, and a loop will bypass the directives or the functions.
Also you can tell the program to die after execution.
{
{
{
{
}
else ('die') add a ; at the end if you wish to make the halt permanent
{
{
That will prevent a loop.
-
I just put it what you posted up there and i just kept getting that error.
-
Well I am not going to fix the code for you, remember when you wanted to make hacks? and I helped you but not handed it to you. If you work for it, then you will have a much better feeling knowing you did it and not had others do it for you.
You have a few malformed "Statements" then it will work. You are like 98% there.
-
What about this?
It didnt work but is it going in a better direction?
Hot or Cold?
#include
using namespace std;
void main (void)
{
int UsersAge = 0;
char Person = 'b';
{
cout << "What is your age?: ";
cin >> UsersAge:
}
{
if ((UsersAge >= 0) && (UsersAge <=4))
Person = 'b';
}
else
{
if ((UsersAge >= 5) && (UsersAge <=20))
Person = 'y';
}
else
{
if ((UsersAge >= 21) && (UsersAge <=65))
Person = 'a';
}
else
{
if ((UsersAge >= 66) && (UsersAge <=135))
Person = 'o';
}
else
Person = 'x';
{
if (Person == 'b')
cout << "Hi there, you are a baby- Becuase you are " << UsersAge << " years old" ;
}
else
{
if (Person == 'y')
cout << "Hi there, you are a teenager- Becuase you are " << UsersAge << " years old" ;
}
else
{
if (Person == 'a')
cout << "Hi there, you are a adult- Becuase you are " << UsersAge << " years old" ;
}
else
{
if (Person == 'o')
cout << "Hi there, you are an old person- Becuase you are " << UsersAge << " years old" ;
}
else
{
if (Person == 'x')
cout << "I think you are lying becuse you are not " << UsersAge << " years old" ;
}
}
-
I thought it had to be like this:
if(blah blah)
{
}
But all my C++ is on my laptop, so I can't be sure right now.
Btw how hard is it to make hack with C++? Cause you will have to learn alot, don't you, before you can make hacks?
-
bonehead can you change my name please?
i want just Ricardo
thx
-
bonehead can you change my name please?
i want just Ricardo
thx
Can we fucking ban this idiot yet!?!?!! Warning at 100, still no ban
-
n o boeman please no ban !!!
-
You are damn close you just have an open and close in the wrong place ;)
-
bonehead can you change my name please?
i want just Ricardo
thx
Ya Bone he wants his name changed, so change it too " Retardo " for posting in the wrong thread!!!!!!!
-
Thank you bonehead, I do not know why I have wanted to put MOFIA, but c nobody as first name!!
-
Well ill close this since some prople are douches. And yeah Boeman Its hard but i sort of know how to make one.