If the sales data for each day one week is represented by th

If the sales data for each day one week is represented by this vector [350 750 800 1250 1700 2000 200]. Write a code that calculates the total dollars in commission this salesperson would receive. Label that output of dollars as total. Upload your m-file.

Solution

sales=[350,750,800,1250,1700,2000,200];
x=0.2; % 20%commission on sales
n=max(size(sales));
totalSales=0;
i=1;
while i<=n
    totalSales=totalSales+sales(i);
    i=i+1;
end
commision=x*totalSales

%out put

commision =

        1410

 If the sales data for each day one week is represented by this vector [350 750 800 1250 1700 2000 200]. Write a code that calculates the total dollars in commi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site