Question: Each week a builder makes an order of doors from a supplier. The doors normally cost $60 each, but the supplier gives a 10% discount

Each week a builder makes an order of doors from a supplier. The doors normally cost $60 each, but the supplier gives a 10% discount for any order of 30 or more doors. The orders for the first 8 weeks of the year are given in the vector:

Orders = [20 40 15 30 25 45 10 35]

(a) Write a MATLAB program using a for loop and if statement to find the total cost of the doors ordered.

(b) Extend your program using the find command to find which weeks the builder obtained a discount.

Step by Step Solution

3.58 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem we will write a MATLAB program with a for loop and if statement for part a and use the find command for part b Part a MATLAB Pro... View full answer

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 Programming Questions!