I'm trying to have the user input a letter M or F so a specific set of statements will follow according to the letter of choice, I'm also having trouble with loop.
// This program will use for loops and
// switch staements to determine measure
// the body fat of either a male or female
//To Do:
// 1: Ask Name
// 2: Determine Gender
// 3: Input Weight & Measurements
// 4: Calculate Fat Percentages
// 5: Repeat Loop ( Well actuallty first thing to do)
// Step 0: Housekeeping
#include <iostream>
usingnamespace std;
#include <string>
int main()
{
// Step 1: Declarations
string name1, name2;
int A1; // [BOTH][Women] (body weight x 0.732) + 8.987 -- [Men] (body weight x 1.082) + 94.42
int A2; // [BOTH][Women] wrist measurement 9 at (fullest point) -- [Men] wrist measurement x 4.15
int A3; // [Women ONLY] waist measurment (at navel) x 0.157
int A4; // [Women ONLY] hip measuremnt (at fullest point) x 0.434
int A5; // [Women ONLY] forearm measurement (at fullest point) x 0.434
int B; // "B" (stands for body perhaps?) -- [Women] B = A1 + A2 - A3 - A4 + A5 -- [Men] B = A1 - A2
int BodyFat; // [BOTH] Body fat = body weight - B
int BodyFatPercnetage; // [BOTH] Body fat percentage = body fat x 100 / body weight
char gender;
// Step 2: For Loop
int i; // Declared to be used with for loop
for (i = 0; i < 5; i++) // for loop
// Step 3: Start of Loop Statements & User Input
{
cout << "Enter the first and last name of the person to measure body fat of." << endl;
cin >> name1, name2;
cout << "Enter M or F, if person is male or female." << endl;
cin >> gender;
switch (gender)
case M: cout << "Male";
break;
case F: cout << "Female";
break;
}
// Step 4: End of For loop & Final Step - Ending Program
return 0;
}