Program starting a new line of code

Hey guys just joined today, I have very little experience with C++ only about 4 months so be gentle. Anyone I have this program and it's working fine the only thing is that it prompts the user (for pounds)twice.It's basically a calorie calculator.
The odd thing is that when it calculates the calories for females it works perfectly even though both the male and female code are almost identical.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  #include <iostream>
using namespace std;
int main()
{
	double weight=0.0;
	double totalCalories;
	char gender = ' ';
	cout << " Are you a male? (Type Y for yes)" << endl;
	cin >> gender;
	if (toupper(gender) == 'Y')
	{
		cout << "Please enter your weight in lbs : " << endl;
		cin >> weight;
		{
			totalCalories = weight * 13;
			cout << "Your Caloric Intake if you aren't active is : " << totalCalories << endl;
		}
		totalCalories = weight * 15;
		cout << "If you are Active your Caloric Intake is :" << totalCalories << endl;
	}
	else
		cout << "You are female, please enter your weight in lbs :" << endl;
	cin >> weight;
	{
		totalCalories = weight * 12;
		cout << "Your Caloric Intake if you aren't active is : " << totalCalories << endl;
	}
	totalCalories = weight * 13;
	cout << "If you are Active your Caloric Intake is :" << totalCalories << endl;
	system("pause");
	return 0;
}
Hello :D

The else-part only contain line 22 so the lines below will run no matter what gender.
Thanks guy!
Topic archived. No new replies allowed.