Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need it MATLAB not C program COMP1200-MatLab Lab 04 Read all instructions before beginning your work Due 11:59 Friday -February 15, 2019 Submit assiqn04a,m
I need it MATLAB not C program
COMP1200-MatLab Lab 04 Read all instructions before beginning your work Due 11:59 Friday -February 15, 2019 Submit assiqn04a,m and assign04b.m via Canvas NOTE: Your submitted file(s) MUST be spelled and cased as instructed Problem 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 massis the body weight in kilograms and height is in meters. [http://en.wikipedia.org/wiki/Body mass dex) 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 wil need to specify the gender by entering a character notation, or 2 IBN (men) -50.0 + 2.3 * (height - 60 IBN (women) -45.5 + 2.3 * (height - 60) Instructions for all assignments scripts See Standards for Documentation of MATLAB Programs on the Canvas Resources page D Insert comments at the top and throughout cach file o Include the follow comments at the beginning of this (and ALL) files Grade of ZERO for files if submitter name not part of Canvas group. Not in a group? GROUP# is ."mone". For your own protection, submitter's name, GROUP # type none" if submitting: alone ALL other group members' names % program file % due date of the assignment % statement about collaboration % name, ex-assign()2a.m DENTS'NAMES M MATCH NAMES ON CANVAS REQUIRED, even if you didn't collaborate. See syllabus for examples. MODIFY narrative to include current requirements. a short narrative about what the file does o Use the algorithm given as comments throughout your program OObserve the instructor's rule for naming variables. o Usc ALL CAPS for constants variablc names o o Use descriptive variable names. Start other variables with lower casc. Ifyou do not submit individually, there will be a 5 POINTS PENALTY for not joining a group on Canvas. Groups can be 2-4 students. Use Sample Input/Output as a guidc. O Code clarity: Indent blocks as needed. Use Smart Indent. Divide your solution program code into sections as noted in the algorithm.DONOT join a group unless you have Use blank lines as needed to group statements. Use section comments as well as the algorithm step comments. Remove statements from previous assignments that do not apply to the current requirements o o worked with the other members. Ifyou do, you wl be removed from the group and given the grade of zero. o o Use comments to show units Use the CONSTANT and variable names; not numbers. Exceptions are incrementers and numbers without identity No extra output, i.e. use semicolons Program: assign04a.m Save your assign03a.m as assign04a.m. Modify the script for the new requirements. 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) Additional Problem Inputs: (with units) Additional Problem Outputs: (with units) Use caution when modifying your script. PLAN Change as required onc gender IBW in pounds Additional Other variables: (with units) Equations: Algorithm: Use as comments below. as needed See above and previous assignments. See below Sample run output 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 Test with bad and good data. New commands loop to validate user input while DO NOT use break or continue in this class to select gender equation switch Yes there is a blank line here The BMI is 22.378 BMI Classification: Normal The ideal weight for 72 inches is 171.077 pounds Continue commands disp() if elseif else num2str ) Use Smart Indent Start your program file by typing the following into your empty editor window. .Type yours/your group and other required information comments. .Type the algorithm as given helow as comments to guide you when writing the MATLAB instructions to do the tasks to solve the given problem. Belo w the comment, type the MATLAB statement(s) that do what the comment says submitter's name. GROUP # other group members' names program file name a due date of the assignment * a short narrative about what the file docs; clc, clear all % INPUT statement(s) about collaboration. See syllabus for examples. include current requirements Until good height, prompt user to enter a value for height in inches 8 Until good weight, prompt user to enter a value for weight in pounds t Until good gender, prompt user to enter the gender or 2) Compute conve rsion % Compute BMI Compute the IBM for the given height and gender Convert IB' to pounds % OUTPUT % Display BMI % Display BMI classification % Display 1BW Program: assign04b.m Save your assign4a.m as assign04b.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) Additional Problem Inputs: (with units) New commands counting loop for Continue commands loop to validate user input while onc number of people Additional Problem Outputs: (with units) Additional Other variables: (with units) Equations Algorithm: Use as comments below non to select gender use switch as needed Sce above and previous assignments See belovw if..elseif..else num2str ) Use Smart Indent Enter number of people for health stats: 3 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 BMI Classification: Normal 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. Y 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 BMI Classification: Normal The ideal weight for 68 inches is 140.8739 pounds Start your pogramfile by typing the following into your empty editor window . Type yours your group and other required information comments. e Type the alorthm 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, GROUP # other group members' names program file name due date of the assignment statement(s) about collaboration. See syllabus for examples 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 conversions Compute BMI Compute the IBM for the given height and gender Convert IBW to pounds % Display BMI % Display BMI classification NOTE: Your submitted filefs) MUSTbe spelled and cased as instructed. Dashes added by Canvas accepted. Display IBW Submit via Canva assign04a.m assign04b.m MATLAB script file MATLAB script file One submission per group. Canvas links members to file(s) and rubricStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started