#include using namespace std; int inches2feet(int inches); int inches2inches(int inches); int rdht(char c1,char c2); void outht(int inches); int main() { char gender; int ft,in,m,f,ht; while(1){ cout << "Is the child a boy (m) or a girl (f)?"; cin >> gender; switch(gender){ case 'M': case 'm': m = rdht('m','o'); f = rdht('f','a'); outht((13*m/12+f)/2); break; case 'F': case 'f': m = rdht('m','o'); f = rdht('f','a'); outht((m+12*f/13)/2); break; default: exit(0); } } return 0; } int inches2feet(int inches){ return (inches/12); } int inches2inches(int inches){ return (inches % 12); } int rdht(char c1,char c2){ int feet, inches; cout << "What is the height of the " << c1 << c2 << "ther(feet and inches)?"; cin >> feet >> inches; return (12*feet + inches); } void outht(int h){ int ft,in; ft = inches2feet(h); in = inches2inches(h); cout << "The height of the child will probably be " << ft << " feet " << in << " inches\n"; }