Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions