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
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