程序代写代做代考 algorithm Read all instructions before beginning your work.

Read all instructions before beginning your work.
Problem:
COMP1200-MatLab – Assign 03
Due 11:59 CST – Friday, July 3 Submit assign03a.m and assign03b.m via Canvas
Individual submission
NO groups
NO collaboration statement
NOTE: Your submitted file(s) MUST be spelled and cased as instructed.
A growing number of people are becoming more health conscious watching their diet and exercising more. Statistics are available to help them monitor their progress toward becoming a healthier person. The body mass index (BMI) is a statistical measure which compares a person’s weight and height. Though it does not actually measure the percentage of body fat, it is used to estimate a healthy body weight. The following equation is used to calculate body mass index. Note: The mass is the body weight in kilograms and height is in meters. [http://en.wikipedia.org/wiki/Body_mass_index]
You have discovered equations to calculate the Ideal Body Weight (IBW) and want to add this feature to your program. The following equations are used to compute the IBW, where height is in inches and the IBW is in kilograms. The user will need to specify the gender by entering a character notation, 1 or 2.
IBW (men) = 50.0 + 2.3 * (height – 60) IBW (women) = 45.5 + 2.3 * (height – 60)
Instructions for all assignments scripts:
See Standards for Documentation of MATLAB Programs on the Canvas Resources page. Insert comments at the top and throughout each file.
o
o
Include the follow comments at the beginning of this (and ALL) files.
% program file name, ex. assign02a.m ALL STUDENTS’ NAMES MUST MATCH NAMES ON CANVAS. % due date of the assignment
% a short narrative about what the file does
MODIFY narrative to include current requirements.
Use the algorithm given as comments throughout your program.
Observe the instructor’s rule for naming variables. o Use ALL CAPS for constants variable names.
o Start other variables with lower case. o Use descriptive variable names.
Use Sample Input/Output as a guide. Code clarity:
o Indent blocks as needed. Use Smart Indent.
o Divide your solution program code into sections as noted in thealgorithm.
Use blank lines as needed to group statements.
o Use section comments as well as the algorithm step comments.
o Remove statements from previous assignments that do not apply tothe
current requirements.
Use comments to show units.
Use the CONSTANT and variable names; not numbers. Exceptions are incrementers and numbers withoutidentity. No extra output, i.e. use semicolons
Individual submission NO groups
NO collaboration statement
Program: assign03a.m
You are to write a program (a MATLAB script file) that prompts the user to enter a weight in pounds and a height in inches (1 kilogram = 2.2046 pounds, 1 inch = 2.54 centimeters). Using the algorithm and sample output as a guide, to get the data, determine the BMI and IBW; and display the BMI, BMI category, and Ideal Body Weight for the user-entered gender. Because people make mistakes, all data needs to be validated as correct before using it.
Additional Problem Constants: (with units) None.
Additional Problem Inputs: (with units) gender
Additional Problem Outputs: (with units) IBW in pounds

Additional Other variables: (with units) as needed
Equations:
See above and previous assignments. Algorithm: Use as comments below.
See below.
Sample run output:
Test with bad and good data.
Enter the height in inches(59-78): 58
Enter the height in inches(59-78): 79
Enter the height in inches(59-78): 72
Enter the weight in pounds(90-350): 85
Enter the weight in pounds(90-350): 355
Enter the weight in pounds(90-350): 165
Is the person a female(1) or male(2)? Enter 1 or 2: 5 Is the person a female(1) or male(2)? Enter 1 or 2: 2
commands
loop to validate user input
while
DO NOT use break or continue in this class.
to select gender equation
switch
input() disp() if…elseif…else num2str() Use Smart Indent
 Yes…there is a blank line here. The ideal weight for 72 inches is 171.077 pounds.
Start your program file by typing the following into your empty editor window.
• Type the algorithm as given below as comments
to guide you when writing the MATLAB instructions to do the tasks to solve the given problem
• Below the comment, type the MATLAB statement(s) that do what the comment says.
% submitter’s name
% program file name
% due date of the assignment
% a short narrative about what the file does; include current requirements
clc, clear all
%*****INPUT*****
% Until good height, prompt user to enter a value for height in inches % Until good weight, prompt user to enter a value for weight in pounds % Until good gender, prompt user to enter the gender (1 or 2) %*****COMPUTE*****
% Compute conversions
% Compute BMI
% Compute the IBW for the given height and gender
% Convert IBW to pounds
%*****OUTPUT*****
% Display BMI
% Display IBW
The BMI is 22.378

Program: assign03b.m
Save your assign03a.m as assign03b.m. Modify the script process the health stats for multiple
people. Ask the user to enter the number of people.
Additional Problem Constants: (with units) None.
Additional Problem Inputs: (with units) number of people
Additional Problem Outputs: (with units) none
Additional Other variables: (with units) as needed
Equations:
See above and previous assignments. Algorithm: Use as comments below.
See below.
Enter number of people for health stats: 3
commands
counting loop
for
loop to validate user input
while
to select gender use
switch
disp() if…elseif…else num2str() Use Smart Indent
Test with bad and good data. Yes…there is a blank line here.
Person # 1
Enter the height in inches(59-78): 58
Enter the height in inches(59-78): 79
Enter the height in inches(59-78): 72
Enter the weight in pounds(90-350): 85
Enter the weight in pounds(90-350): 355
Enter the weight in pounds(90-350): 165
Is the person a female(1) or male(2)? Enter 1 or 2: 2 The BMI is 22.378
The ideal weight for 72 inches is 171.077 pounds.
blank line
Person # 2
Enter the height in inches(59-78): 69
Enter the weight in pounds(90-350): 175
Is the person a female(1) or male(2)? Enter 1 or 2: 1 The BMI is 25.843
BMI Classification:
Overweight
The ideal weight for 69 inches is 145.9445 pounds.
blank line
Person # 3
Enter the height in inches(59-78): 68
Enter the weight in pounds(90-350): 130
Is the person a female(1) or male(2)? Enter 1 or 2: 1 The BMI is 19.7664
The ideal weight for 68 inches is 140.8739 pounds.

Start your program file by typing the following into your empty editor window.
• Type the algorithm as given below as comments
to guide you when writing the MATLAB instructions to do the tasks to solve the given problem.
• Below the comment, type the MATLAB statement(s) that do what the comment says.
% submitter’s name
% program file name
% due date of the assignment
% a short narrative about what the file does; include current requirements
clc, clear all
%*****INPUT*****
% Enter number of people to process
% For each person
% Until good height, prompt user to enter a value for height in inches
% Until good weight, prompt user to enter a value for weight in pounds % Until good gender, prompt user to enter the gender (1 or 2)
%*****COMPUTE*****
% Compute conversions
% Compute BMI
% Compute the IBW for the given height and gender
% Convert IBW to pounds
%*****OUTPUT***** % Display BMI
% Display IBW
Submit via Canvas:
assign03a.m
assign03b.m
MATLAB script file MATLAB script file
NOTE: Your submitted file(s) MUST be spelled and cased as instructed. Dashes added by Canvas accepted.
One submission per group. Canvas links members to file(s) and rubric.