Use MatLab to solve : For product [A, B, C, D, E, F] Given matrix Price = [ 10, 20, 15, 27, 30, 25] Quantity = [100, 50, 75, 40, 80, 75] 1. Find total income from each product 2. Find total income generated from all Sales
Product = ["A", "B", "C", "D", "E", "F"]; Price = [ 10, 20, 15, 27, 30, 25] Quantity = [100, 50, 75, 40, 80, 75]; % total income from each product for i=1:length(Price) fprintf("Total income of product %s is %f\n",Product(i),(Price(i)*Quantity(i))); end % total income generated from all Sales total = 0; for i=1:length(Price) total = total + Price(i)*Quantity(i); end fprintf("Total income generated from all Sales = %f\n",total);
Get Answers For Free
Most questions answered within 1 hours.