Design a BMI calculator Using MATLAB, design and implement a program which calculates the user's Body Mass Index (BMI) from a set of simple user inputs. A template of what I have so far is below

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Design a BMI calculator Using MATLAB, design and implement a program which calculates the user's Body Mass Index (BMI) from a set of simple user inputs. A template of what I have so far is below
disp('This programme calculates your Body Mass Index (BMI).')
% declare variables
% obtain user input for their weight
weight = input('Please enter your undressed body mass in (kg): ');
% check they provided valid input
while (weight <= 0)
% this loop iterates until the user enters a positive number
weight = input('Please enter a positive number. Your undressed body mass in kilograms is
required: ');
%3D
end
% obtain user input for their height
% check they provided valid input
% calculate BMI
% BMI = weight (in kg) divided by height (in m) squared
BMI = 0;
% print feedback for each range of BMI
if (BMI < 18.5)
fprintf('Please change your diet to increase calorie intake.\nEat more seeds and nuts.')
end
% Tables
create a table which gives the equivalent BMI for the user's height over a reasonable
range of weights (50 kg - 1e0 kg) like this: XFor your height, this is your equivalent BMI for
a range of weights (50-100 kg): weight [kg] BMI 50 ? 55 ? 60 ? ... 100 ?
Modify this table to go from 90% of the user's weight to 110% in steps of 1 kg;
Reverse this calculation, giving the user their equivalent weight for each point on the
BMI scale from 18 to 25, in steps of 0.5.
% Graphs
% a plot of weight vs BMI (weight in kg on the y-axis) with data points only;
% Fully label this plot and style;
% Add a line on the graph that indicates the user%s actual weight
disp('Thank vou for using BMI calculator.')
Transcribed Image Text:disp('This programme calculates your Body Mass Index (BMI).') % declare variables % obtain user input for their weight weight = input('Please enter your undressed body mass in (kg): '); % check they provided valid input while (weight <= 0) % this loop iterates until the user enters a positive number weight = input('Please enter a positive number. Your undressed body mass in kilograms is required: '); %3D end % obtain user input for their height % check they provided valid input % calculate BMI % BMI = weight (in kg) divided by height (in m) squared BMI = 0; % print feedback for each range of BMI if (BMI < 18.5) fprintf('Please change your diet to increase calorie intake.\nEat more seeds and nuts.') end % Tables create a table which gives the equivalent BMI for the user's height over a reasonable range of weights (50 kg - 1e0 kg) like this: XFor your height, this is your equivalent BMI for a range of weights (50-100 kg): weight [kg] BMI 50 ? 55 ? 60 ? ... 100 ? Modify this table to go from 90% of the user's weight to 110% in steps of 1 kg; Reverse this calculation, giving the user their equivalent weight for each point on the BMI scale from 18 to 25, in steps of 0.5. % Graphs % a plot of weight vs BMI (weight in kg on the y-axis) with data points only; % Fully label this plot and style; % Add a line on the graph that indicates the user%s actual weight disp('Thank vou for using BMI calculator.')
Step 2 - Feedback
The minimum requirement is to use if and else statements to check the user's BMI:
1. if their BMI is in the range 18.5 < BMI < 25, congratulate them on their healthy weight;
2. if their BMI is less than 18.5, suggest change in their diet to increase calorie intake;
3. if their BMI is greater than 25, be polite!!!! (But let them know they're health implications).
Step 3 - Tables
Ensure that all tables are clear and neat with explanation to the user. Use loops to produce tables. The minimum
requirement is:
1. In your BMI calculator, create a table which gives the equivalent BMI for the user's height over a reasonable
range of weights (50 kg - 100 kg) like this: 'For your height, this is your equivalent BMI for a range of weights
(50-100 kg): weight [kg] BMI 50 ? 55 ? 60 ?... 100 ?"
2. Modify this table to go from 90% of the user's weight to 110% in steps of 1 kg;
3. Reverse this calculation, giving the user their equivalent weight for each point on the BMI scale from 18 to
25, in steps of 0.5.
Step 4- Plotting
When plotting, ensure that all plots are neat, black & white and clearly, fully labelled.
1. Create a plot of Weight vs BMI (weight in kg on the y-axis) with data points only;
2. Fully label this plot and style;
3. Add a line on the graph that indicates the user's actual weight.
Step 5- Individual Improvements
Above steps list compulsory functional requirements.
You need to extend your assignment work to include additional features to improve functinality and usability of your BMI
calculator.
Transcribed Image Text:Step 2 - Feedback The minimum requirement is to use if and else statements to check the user's BMI: 1. if their BMI is in the range 18.5 < BMI < 25, congratulate them on their healthy weight; 2. if their BMI is less than 18.5, suggest change in their diet to increase calorie intake; 3. if their BMI is greater than 25, be polite!!!! (But let them know they're health implications). Step 3 - Tables Ensure that all tables are clear and neat with explanation to the user. Use loops to produce tables. The minimum requirement is: 1. In your BMI calculator, create a table which gives the equivalent BMI for the user's height over a reasonable range of weights (50 kg - 100 kg) like this: 'For your height, this is your equivalent BMI for a range of weights (50-100 kg): weight [kg] BMI 50 ? 55 ? 60 ?... 100 ?" 2. Modify this table to go from 90% of the user's weight to 110% in steps of 1 kg; 3. Reverse this calculation, giving the user their equivalent weight for each point on the BMI scale from 18 to 25, in steps of 0.5. Step 4- Plotting When plotting, ensure that all plots are neat, black & white and clearly, fully labelled. 1. Create a plot of Weight vs BMI (weight in kg on the y-axis) with data points only; 2. Fully label this plot and style; 3. Add a line on the graph that indicates the user's actual weight. Step 5- Individual Improvements Above steps list compulsory functional requirements. You need to extend your assignment work to include additional features to improve functinality and usability of your BMI calculator.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY