according to the weight standards recommended by the World Health Organization, men's standard weight = (height cm-80) X70﹪, women's standard weight = (height cm-70) X60﹪. The standard body weight positive and negative 10﹪ is normal body weight, the standard body weight positive and negative 10﹪~ 20﹪ is overweight or excessively light, the standard body weight and positive 20﹪ above is obese or underweight, in which the overweight formula is: overweight (%) =[(actual weight-standard weight)/(standard body weight)]x100%, body weight is kg.
please write a program, enter a person's name, gender, height, weight, with a strong human voice to output their weight (normal, overweight, too light, fat or underweight), the program can be used in the scale for people to report the weight of the situation in real time.
Requires that a struct type be used to represent information about a person.
#include <iostream>using namespace std;struct person{ char name[20]; char sex; Double height; double weight;}; int main () { Double St, over; person p; cout<< "Please enter your name:"; cin>>p.name; cout<< "Please enter your gender (f/m):"; cin>>p.sex; cout<< "Please enter your elevation (cm):"; cin>>p.height; cout<< "Please enter your weight (kg):"; cin>>p.weight; if (p.sex== ' F ' | | p.sex== ' F ') st= (p.height-70) *0.6; else st= (p.height-80) *0.7; Over= (p.weight-st)/st; if (over>0.2) cout<< "Would you be a sumo wrestler?" "<<endl; else if (over>0.1) cout<< "You have to control your diet!" Eat more so you can go to sumo. ╮(╯▽╰)╭ "<<endl; else if (over>-0.1) cout<< "(⊙o⊙) Ah!!! You're in good shape! Envy%>_<% "<<endl; else if (over>-0.2) cout<< "eat some more!" "<<endl; else cout<< "You are so .... The wind can blow you down! Hurry up and eat a little more fat! "<<endl; return 0;}
Fat Man can't hurt!