Question: Write a single statement that assigns totalCost with the discounted cost of item 1 and item 2. Use the provided function DiscountedPrice to determine
Write a single statement that assigns totalCost with the discounted cost of item 1 and item 2. Use the provided function DiscountedPrice to determine the discounted cost of each item function saleltenCost DiscountedPrice(originalltenCost, discounteditate) XoriginalltenCost: Original cost of an ites in dollars X discountedRate: Discount rate as a decimal value salettenCost originalitemCost (1 discountedRate); end Ex Item 1 costs 10 and has a 05 discount rate, and item 2 costs 20 and has a 0.4 discount rate, then assign totalCost with 17 (exc Discounted Price(10.0.5) Discounted Price(20,0 4) is equal to 5+12) Function function totalCost CartTotal (itemiCost, itemlDiscount, Itemost, item Discount) Assign totalCost with the discounted cost of items 1 and 2 totalCost-Discounted Price (itemPrice) DiscountedPrice (ites2Price); + end . Save Reset Code to call your function 1 Carttotal(10, 0.5, 20, 0.4) MATLAB Documentation Reset
Step by Step Solution
3.38 Rating (139 Votes )
There are 3 Steps involved in it
The detailed answer for ... View full answer
Get step-by-step solutions from verified subject matter experts
