Question
2.1) A company is going to provide a Discount Day to their customers and needs a MATLAB script to do the following: Request the price
2.1) A company is going to provide a Discount Day to their customers and needs a MATLAB script to do the following: Request the price of a product. Call the function that will produce the final price after calculating a discount based on a random number. The random number and the calculation of the final price will be performed by a separate function (see question 2.2 for details). Display the final price to the customer.
2.2) Create a function to process the discount for question 2.1. This function (on its own MATLAB .m file) will do the following after receiving the original price of a product: Generate a random integer between 1 and 5 (including also 1 and 5). Such number will be calculated as a percent discount between 1% and 5%. Calculates the final price after applying the discount. Therefore, the function will return the final price to be paid by the customer.
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