Question: ENGR 1560: Engineering Computing home 3.3 Custom functions E zyBooks catalog Function call in expression: Reduced pricing Wrte a single statement that assigns totalCost with
ENGR 1560: Engineering Computing home 3.3 Custom functions E zyBooks catalog Function call in expression: Reduced pricing Wrte a single statement that assigns totalCost with the discounted cost of tem 1 and item 2 Use the provwided tunction DiscountedPrice to determine the discounted cost of each item: function saleItemcost - DiscountedPrice(originalItemcost, discountedRate) % originalltemCost: 0riginal cost of an item in dollars Rate: Discount rate as a decimal valued saleItemcost originalItemcost (1 discountedRate): Ex Ir item 1 costs 10 and has a 0.5 discount rate, and the item 2 costs 20 and has a 0.4 discount rate, then assign totalCost with 17 (Le DiscountedPrice(10, 0.5) + DiscountedPrice(20, 0.4) is equal to 5+12) Your Function Save C Reset MATLAB Documentation il function totalcost CartTotal(itemiCost, item1Discount, item2Cost, item2Discount) | % Assign totalcost with the discounted cost of items 1 and 2 totalcost (item1Cost"item1Discount)+(item2Cost item2Discount) C R Code to call your function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
