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
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...
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.')](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5e3acd95-e354-4ee6-a46d-027a2e7dd951%2Fc2833efb-4ed8-4fe4-a829-566edd552a95%2F08dbfmp_processed.jpeg&w=3840&q=75)
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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5e3acd95-e354-4ee6-a46d-027a2e7dd951%2Fc2833efb-4ed8-4fe4-a829-566edd552a95%2Fuu27byc_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY