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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!