Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access with AI-Powered 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