Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please, I need help with this coding of Matlab. I am stuck ENGR 215 ENGR 215 Lab Assignment #4 Due See Canvas Due Date >In

Please, I need help with this coding of Matlab. I am stuckimage text in transcribed

ENGR 215 ENGR 215 Lab Assignment #4 Due See Canvas Due Date >In makeChangeRecursive at 22 change - Problem 2: Linear Recursion 1) Write a function change, flag]-makeChangeRecursive (cost,paid) that takes the cost of an item cost (a lx1 double) and the amount paid by the buyer paid (a xl double), and retums a n 1 column array of doubles change containing the bills that the seller should give back to the buyer in decreasing order and flag a lxl logical true or false saying whether the transaction was "completed". If paid is less than cost, flagis false and you should display a warning in the command window saying "That's not cnough to buy that item." and change is assigned as an empty array. If cost and paid are equal the change is assigned as an empty array and flag is true. Ifpaid is greater than cost, flag is true and change is the difference between the two made by combining the denominations: 100, 50, 20, 10, 5, 2, and 1 IMPORTANT! The function makeChangeRecursiveMUST use recursion to create the variable change. No points will be awarded if you use a for or while loops. flag TEST CASE 5 >> [change, flag)makeChangeRecursive (50,100) change rlag TEST CASE 1 [change, flamakeChangeRecursive (2,100) change Problem 3: Recursive Branching The Koch curve, describes by Helge von Koch is a fascinating curve, that is well suited to be created recursively For excellent graphics and information on how to construct the Koch curve please read the following: 50 20 https:Jen.wikipedia.org wiki/Koch_snowflake For this problem, you must download Kock.m from canvas. Your task is to read through the code and add comments to every line of executable code that is currently uncommented. You must re-upload to Canvas your commented version of the code. tlag TEST CASE 2 [change, flag- makeChangeRecursive (3,20) change = DELIVERABLES Upload all the files below to Canvas according to the due date for your lab section tribNu.m makeChangeRecursive.m lag Be sure to turn in ALL the functions requested and that they are named exactly as specified, including spelling and case. TEST CASE 3 > [change, flag change makeChangeRecursive (20,20) lag TEST CASE > change, flag-makeChangeRecursive (59,20) Warning: That's not enough to buy that item

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

=+ What is the role of government in bargaining?

Answered: 1 week ago

Question

=+ Who is the negotiation partner at company level?

Answered: 1 week ago

Question

=+Which associations exist?

Answered: 1 week ago