Question: Please help me continue the program in c++ that calculates the bmi and then displays the recommended diet implementing any of these( stacks,queues,linked list, binary
Please help me continue the program in c++ that calculates the bmi and then displays the recommended diet implementing any of these( stacks,queues,linked list, binary search ) also using the header files.
this is the program that i made
#include#include using namespace std; struct diet { double height; double weight; string name; double BMI; string info; diet *next; }; void calcBMI(double weight, double height){ double BMI; BMI = (weight / (height * height)); cout << BMI; } void recDiet(double BMI){ if (BMI < 18.5){ cout << "You are Underweight. "; } if (BMI >= 18.5 && BMI <= 24.9){ cout << "The diet you need is Vegan Diet"; } if (BMI >= 25 && BMI <=29.9){ cout << "You are Overweight. "; } if (BMI >= 30){ cout << "You are obese. "; } if (BMI <= 24.9){ cout << "The diet you need is Raw food diet"; } if (BMI = 18.5){ cout << "The diet you need is Ketogenic Diet"; } if (BMI <= 18.5){ cout << "The diet you need is Mediterranean diet"; } if (BMI >= 18.5 && BMI <= 24.9){ cout << "The diet you need is South beach diet, or The Zone Diet"; } if (BMI >= 25 && BMI <=29.9){ cout << "The diet you need is Vegan Diet. "; } if (BMI >= 30){ cout << "The diet you need is Weight watcher diet "; } void addData(diet *&head, diet *&last, double BMI, string recommend){ diet *temp = new diet; temp->BMI = BMI //temp->info = head = temp; last = temp; } int main() { double weight; double height; double bmi; cout << "Enter weight: "; cin >> weight; cout << "Enter height: "; cin >> height; cout << "Your BMI is "; calcBMI(weight, height); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
