Hi there, I'm new to the programming area so I've just been testing a few things out with a 'how old are you' script, and I'm struggleing on true and false statements,
A lot of what I've done is guese work so not surprising it's wrong, but heres the bit of the script I'm strugleing with:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
int school;
bool schoola = false;
school = age <=16;
cout << "second part.." <<endl;
cout << "so you are " << age << " years old" <<endl;
if (school)
{
cout << "you are still in school" <<endl;
}
if (schoola = true)
{
cout << "yes it is true then you are still in school" <<endl;
}
if (schoola = false)
{
cout << "you arent in school but its saying its true neway!" <<endl;
}
The code allways comes out with the true statement, no matter what age I put in.
this is only part of the full script but the rest of it I havnt had a problem with. Any tips on how to do the true/false correctly would be much appreciated.