Question

Use MatLab to solve Given matrix Price = [ 10, 20, 15, 27, 30, 25]                      ...

Use MatLab to solve

Given matrix Price = [ 10, 20, 15, 27, 30, 25]

                      Quantity = [100, 50, 75, 40, 80, 75]

Question: 1. find the average price

                 2. find how many items are sold above the average price

                 3. Find the total income from transaction whose price is above the average price found in (1) above

                 3. find total income from transactions whose price is above the average price

Homework Answers

Answer #1
Price = [ 10, 20, 15, 27, 30, 25];
Quantity = [100, 50, 75, 40, 80, 75];

% Part 1
avg = 0;
for i=1:length(Price)
    avg = avg + Price(i);
end
avg = avg / length(Price);
fprintf("Average price = %.2f\n",avg);

% Part 2
aboveAvg = 0;
for i=1:length(Price)
    if(Price(i)>avg)
        aboveAvg = aboveAvg + 1;
    end
end
fprintf("Number of items are sold above the average price = %d\n",aboveAvg);

% Part 3 and 4
totalPrice = 0;
for i=1:length(Price)
    if(Price(i)>avg)
        totalPrice = totalPrice + (Price(i)*Quantity(i));
    end
end
fprintf("Total income from transaction whose price is above the average price found = %.2f\n",totalPrice);


Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The data collection is conducted by randomly selecting 51 persons whose ages are between 25-30 and...
The data collection is conducted by randomly selecting 51 persons whose ages are between 25-30 and interviewing the average time they spend on Instagram in a day. What is the probability that people ages between 25-30 spend time using Instagram for more than one hour in a day? I need a PMF equation The collected data: Number of Person Time Number of Person Time Number of Person Time Number of Person Time 1 120 14 90 26 120 39 70...
Quantity Total Cost 0 $62 10 $90 20 $110 30 $126 40 $144 50 $166 60...
Quantity Total Cost 0 $62 10 $90 20 $110 30 $126 40 $144 50 $166 60 $192 70 $224 80 $264 90 $324 100 $404 The table above shows a strawberry farm's short-run production and cost schedule. Suppose that the prevailing market price is $6 per pack of strawberries. (a) How much is the fixed cost? (b) Find the profit-maximizing quantity and obtain the resulting maximum profit.
Given the demand and supply curves p=50 - 0.0001 q^2 p=10 + 0.00015 q^2 Q# provide...
Given the demand and supply curves p=50 - 0.0001 q^2 p=10 + 0.00015 q^2 Q# provide the following graphically and numerically. (When you finish, you will have 8 different graphs. ) 1) The equilibrium quantity and price 2 )The total revenue if this number of items are sold at this price (rectangle) 3)The maximum revenue that could result from the sale of this number of items (area under demand function) 4)The minimum revenue that could result in the production of...
The following transactions occurred for the month of May. Date    Units Cost Total Sales Price...
The following transactions occurred for the month of May. Date    Units Cost Total Sales Price 1-May Beginning Balance 70 15 $1,050 2-May Purchase 75 11 $825 3-May Purchase 85 12 $1,020 10-May Sale 150 $35 15-May Purchase 40 18 $720 17-May Sale 50 $35 30-May Sale 40 $35 Create a perpetual inventory record then calculate the Cost of Goods Sold, Ending inventory, and Gross Profit for the month under FIFO Purchases Cost of Goods Sold Inventory on Hand Dates...
Using the Midpoint method compute the elasticity in the following cases and explain your answers.   ...
Using the Midpoint method compute the elasticity in the following cases and explain your answers.    Price Quantity Demanded (Income = AED60,000) Quantity Demanded (Income = AED90,000) 50 2000 1500 75 1500 1000 1. Calculate the income elasticity of demand when income rises from AED 60,000 to AED90,000 at a price of AED 75. (1 Mark) 2. Due to COVID 19, the average price of a Jones the Grocer meal fell from AED100 to AED 80. As a result, Slim’s...
25. If the unit variable cost is equal to 40% of the unit sales price, the...
25. If the unit variable cost is equal to 40% of the unit sales price, the total fixed cost is equal to $ 360,000 and the tax rate is 25%, the amount of sales income necessary to obtain a net profit of taxes of $ 180,000 is: to. $ 600,000 b. $ 780,000 c. $ 1,000,000 d. More information is needed. 26. A company sells its product for $ 80 per unit. The unit variable cost is $ 30 and...
Data Set: 6 8 10 13 15 18 20 21 27 29 30 35 45 49...
Data Set: 6 8 10 13 15 18 20 21 27 29 30 35 45 49 52 54 57 58 Define: mean and median. 1. mean 30.4, median 28 2. mean 28.4 , median 28 3. mean 31.4 , median 29 4. mean 30.4 , median 29 5. None of these answers QUESTION 2 Sample: 45 71 34 88 46 For the given set of numbers, find the mean and the standard deviation. 1. mean: 56.8, deviation: 19.75 2. mean:...
USE TABLE 2 FOR QUESTIONS 24-30 PRICE PER UNIT QUANTITY DEMANDED PER WEEK $12.00 25 $11.50...
USE TABLE 2 FOR QUESTIONS 24-30 PRICE PER UNIT QUANTITY DEMANDED PER WEEK $12.00 25 $11.50 30 $11.00 35 $10.50 40 $10.00 45 $9.50 49 $9.00 50 $8.50 52 $8.00 53 $7.50 54 $7.00 55 24. Using average values what is the price elasticity of demand when price rises from $7.50 to $8? A) 3.45 B) 2.85 C) .70 D) .29 25. Using averages what is the price elasticity of demand when price changes from $8.50 to $9? A) .69...
The demand for product Q is given by Q = 136 -.4P and the total cost...
The demand for product Q is given by Q = 136 -.4P and the total cost of Q by: STC = 3000 + 40Q - 5Q^2 + 1/3Q^3 A. Find the price function and then the TR function. See Assignment 3 or 4 for an example. B. Write the MR and MC functions below. Remember: MR = dTR/dQ and MC = dSTC/dQ. See Assignment 5 for a review of derivatives. C.What positive value of Q will maximize total profit?  Remember, letting...
Week 2 HW: Elasticity Step 1 - E L A S T I C or INELASTIC?...
Week 2 HW: Elasticity Step 1 - E L A S T I C or INELASTIC? Price Elasticity of Demand is a measure of how responsive demand is to a change in price. If a price change leads to a considerably bigger change in quantity demanded, we would consider the good to be responsive to a price change—hence elastic. If, however, a similar price change leads to a much smaller change in demand, we would consider it inelastic. To get...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT