Question: a. Pretend that the function diff does not exist. Implement the function on your own in a script file. Make the solution generic for any

a. Pretend that the function diff does not exist. Implement the function on your own in a script file. Make the solution generic for any input vector.

b. You own a computer store that sells laptops of various brands. You are considering giving a 10% discount on the current prices. However, you are worried that if you give the discount you will lose in terms of revenue. You asked a forecasting firm to predict the next months sales (in quantity) with and without the discount. Using the data below, compute the revenues with and without a discount, and decide if you will proceed with the discount. You must use vector and/or matrix operations in the solution.

The script should print the revenue before & after and print a Boolean true (1) or false (0) for whether you will give a discount or not that will be computed for the specific input. You may solve for the specific example below. Here is the data you need for the analysis:

Prices:

Brand

Price Before Discount

P&H

1000

CAM

1200

LLED

1100

Microhard

1400

Forecasted quantities:

Brand

Quantities before Discount

Quantities after Discount

P&H

50

55

CAM

100

110

LLED

120

125

Microhard

30

50

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!