I'm trying to compile this simple program in Xcode, however, it keeps giving me an error saying expected expression. I thought I had my brackets in the correct place, but cannot find where I'm wrong
For example, lines 10-12 is an if statement, and ends there. Then you have a block of regular code from 13-17 and else without an if on line 19. The pattern is repeated from line 31 downwards.
Also, as mentioned by MikeyBoy you need an else if, as shown below. Don't know if this is what you want to do or not, but formatting like this should help:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
if (gender == "Female")
{
if (activityLevel == "Active")
{
daiyCalories = weight * 12;
cout<<"You are "<<gender<<endl;
cout<<"Your activity level is "<<activityLevel<<endl;
cout<<"Your recommended daily calories is "<<daiyCalories<<endl;
}
elseif (activityLevel == "Inactive")
{
daiyCalories = weight * 10;
cout<<"You are "<<gender<<endl;
cout<<"Your activity level is "<<activityLevel<<endl;
cout<<"Your recommended daily calories is "<<daiyCalories<<endl;
}
}