Question: Write a function in MATLAB, that will output the value of the average calorie counter. At every call, the function receives as input the amount
Write a function in MATLAB, that will output the value of the average calorie counter. At every call, the function receives as input the amount of calories contained in an item of food. The function then returns the average amount of calories for the items entered until that moment. If the total amount calories goes above 2500, the function prints an alert message to let the user know that he/she has reached the recommended calories consumption for one day. Entering zero (0), will cause the function to reset its calories counter and start from zero again. Avoid for or while loops.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
