Adult calorie consumption calculation:
// Adult calories consumed # include <iostream> double metabolism (double weight); double activity (INT degree, double weight, int minutes); int main () {using namespace STD; double weight, calorie; int degree, minutes, N; double cal1, cal2; cout <"Please input the weight, the degree, the Minutes, the calorie of one food :"; cin> weight> degree> minutes> calorie; cal1 = metabolism (weight); cal2 = activity (degree, weight, minutes); n = (Cal1 + cal2)/(0.9 * calorie); cout <"you need" <n <"parts food! "<Endl; return 0;} double metabolism (double weight) {return 70 * (weight/2.2) * 0.765;} double activity (INT degree, double weight, int minutes) {return 0.0385 * degree * weight * minutes ;}
Result:
Please input the weight,the degree,the minutes,the calorie of one food:100 10 10 1000You need 3 parts food!
Adult calories consumed