Question: 4. (4 points) Write a MATLAB program (a2q4.m) that computes and outputs the total amount of money in dollars, given the number of toonies, loonies,

4. (4 points) Write a MATLAB program (a2q4.m) that computes and outputs the total amount of money in dollars, given the number of toonies, loonies, quarters, dimes, and nickels. - Use MATLAB's input command in five statements to prompt the user to enter the number of toonies, loonies, quarters, dimes, and nickels. Assign the entered values to the variables, t,l,q,d, and n, respectively. - As an example, the prompt for the first statement should be "Enter number of toonies: ". (Note: Include a space after the colon.) - From the entered values, compute the total amount of money and assign the result to a variable named dollars. - Display the total amount of money in dollars in the command window: The total in dollars is: xxx where x is the total number of dollars. Since we are currently only using the disp command for output, the portion of dollars in cents, if any, might appear with just a single decimal place
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
