Hi alls....
At the moment I'm a noob to C++ ("not the first time I've seen that" -You say)
But i have been going through the tutorials and up up to um part 3 i think it is and i decided not to go any further until i make a test script so i did i tryd it worked good until!!!
I can't seem to find the problem to my script?
Code:
#include <iostream>
using namespace std;
int main()
{
float age, strength, intellegince, agility;
cout<<"Please input your age: ";
cin>> age;
cin.ignore();
if ( age < 30) {
cout<<"You are pretty young!\n";
}
if (age < 60, age > 30 ) {
cout<<"You are a adult\n";}
if ( age < 101, age > 90 ) {
cout<<"You are old\n";
}
if (age < 89, age > 61 ) {
cout<<"You are getting old now arn't you\n";}
cout<<"Press enter to continue\n";
cin.get();
cout<<"Please input your strength: ";
cin>> strength;
cin.ignore ();
if ( strength < 30) {
cout<<"You are weak\n";}
if ( strength > 31, strength < 60) {
cout<<"You have an average strength\n";}
if ( strength > 61, strength < 89) {
cout<<"You are quite strong\n";}
if ( strength > 90, strength < 101){
cout<<"You are very strong\n";}
cout<<"Press enter to continue\n";
cin.get();
cout<<"Please input your intelligence:";
cin>> intillegence;
cin.ignore();
if ( intelligence < 29) {
cout<<"You are dumb\n";}
if ( intelligence < 60, intelligence > 30) {
cout<<"You have an average intelligence\n";}
if ( intelligence < 89, intelligence > 61) {
cout<<"You are quite smart\n";}
if ( intelligence < 101, intelligence > 90){
cout<<"You are very smart\n";}
cout<<"Press enter to continue\n";
cin.get();
}
When you run it its asks your age, strength, etc
but when you enter 65 it displays the
Code:
if ( strength > 31, strength < 60) {
cout<<"You have an average strength\n";}
if ( strength > 61, strength < 89) {
cout<<"You are quite strong\n";}
Both "You have an average strength\n" and "You are quite strong\n"
Why!? i had the problem when typing 45 but fixed it but now this?
Someone please help!?