Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Topics: User Defined Functions and MATLAB Conditionals A online retailer has hired you to write a program to calculate the total cost of a customer's
Topics: User Defined Functions and MATLAB Conditionals A online retailer has hired you to write a program to calculate the total cost of a customer's order. First the retailer must enter the name and the price per unit for two different candies. Then, the customer is allowed to order as many units of each of the two candies as they would like Lastly, an invoice report) is generated displayed to the screen) under the following rules 1. All units up to and including the 20th are sold at full price 2. All unit in excess of 20 are sold at a 10% discount. 3. For each candy there must be a separate line indicating: o The candy's name o The candy's full unit price o How many units are being sold at full unit price o The resulting subtotal And if applicable, another line indicating o The candy's name o The candy's discounted unit price o How many units are being sold at discounted unit price o The resulting subtotal 4. There must be a line indicating the total of the order. 5. There must be a line indicating the sales tax on the total of the order (based on a 5% sales tax) 6. There must be a line indicating the grand total of the order. Finish the following MATLAB function and write a MATLAB Script that (uses that function) to satisfy the above description
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started