Convert This Code to Switch Statement...
#include <iostream>
#include <math.h>
using namespace std;
void main()
{
char gender;
float a1, a2, a3, a4, a5,bw,wsm,wrm,hm,frm;
cout << "Are you a man or a woman? \n Enter M for Man & F for Woman";
cin >> gender;
while (gender != 'm' && 'M' && 'f' && 'F')
{
cout << "You have entered an invalid input \n Enter M for Man & F for Woman" << endl;
cin >> gender;
}
if (gender == 'm' || 'M')
{
cout << "Enter the Body Weight ";
cin >> bw;
cout << "Enter the Waist Measurement ";
cin >> wsm;
cout << "Enter the Wrist Measurement ";
cin >> wrm;
cout << "Enter the Hip Measurement ";
cin >> hm;
a1 = (bw*1.082) + 94.42;
a2 = wrm*4.15;
cout << "Your Body Fat is " << ((bw - (a1 - a2)) * 100) / bw<<endl;
}
else
{
cout << "Enter the Body Weight ";
cin >> bw;
cout << "Enter the Waist Measurement ";
cin >> wsm;
cout << "Enter the Wrist Measurement ";
cin >> wrm;
cout << "Enter the Hip Measurement ";
cin >> hm;
cout << "Enter the Fore arm Measurement ";
cin >> hm;