I am trying to put a 'Invalid' statement in my code and not sure how to do this. Could someone please help me with this? Thank you in advance. Here is my code:
#include <iostream>
#include <iostream>
#include <cctype> // is needed for toupper()
#include <cstdlib> // is needed for system()
using std :: cout;
using std :: cin;
using std :: endl;
using std :: toupper;
using std :: system;
int main ()
{
//Variables
double calories = 0.0;
double weight = 0.0;
int weight_mod = 0;
char gender = ' ';
char level = ' ';
//enter gender
cout << "Enter Gender: ";
cin >> gender;
gender = toupper(gender);
cout << "Enter Your Activity Level (A/I): ";
cin >> level;
level = toupper(level);
cout << "Enter Current Weight: ";
cin >> weight;
if (gender == 'F' && level == 'A')
{
weight_mod = 12;
}
else if (gender == 'F' && level == 'I')
{
weight_mod = 10;
}
else if (gender == 'M' && level == 'A')
{
weight_mod = 15;
}
else if (gender == 'M' && level == 'I')
{
weight_mod = 13;
}
// calculate
calories = weight * weight_mod;
// display output
cout << "You need this many calories daily to maintain your weight: " << calories << endl;
system ("pause");
return 0;
} //end main function