Question

Vle/content/731186/fullscreen/3876261/View n3x You are the owner of three small grocery stores in your city. You want to know how much money you made last week selling pre-packaged gift boxes of fruit (a box contains just apples, oranges, pears, or plums). You purchase the fruit boxes wholesale from your distributor (apples S3.20/box, oranges $3.65/box, pears $4.00/box, plums $3.50 box). Your selling price includes a 30% markup and is rounded to the nearest dime. Note: Markup % s(selling price-cost) /cost x100 For example, if the wholesale price of a single box of apples from the distributor is $3.20, you would mark it up by 30% to S4 16. The final selling price is rounded to $4.20. If you sold one box, then your gross profit from the sale is $4.20- 3.20- $1.00 Write a MATLAB script that meets these specifications: Create a 4x1 column vector that holds the wholesale prices (given above) for each type of fruit box. For each of the three stores, prompt the user to enter the number of boxes sold for each type of fruit. The #0ranges ,pears tplums] user should enter the box quantities as a vector, like this: [apples Create a 3x4 matrix from the three vectors of box sales data. Each row in the matrix corresponds to a particular store. Calculate the gross profit earned at each store. Hint: Matrix-vector math (using *, t, or- operators and the sum function) can quickly solve the equations. Calculate the total profit of all the stores combined. . Display a table showing the number of fruit boxes sold at each store. Hint: You are free to design the layout for the output, but you may want to investigate the array2table function to make your life easier. . Display a summary of the total number of apple all the stores combined. Display a summary of the profit made at each store. Display the total profit. . Save the script using this file name: hw3x2.m *

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)matlab code

clear;clc;
cp=[3.20;3.65;4.00;3.50]; %wholesale price per box
sp=(1+30/100)*cp;
sp=floor(sp)+round(10*(sp-floor(sp)))/10; %selling price per box
gain=sp-cp; %profit per box
b1=input('enter the no of boxes sold for store 1 for #apple,#orange,#pears,#plums =');
b2=input('enter the no of boxes sold for store 2 for #apple,#orange,#pears,#plums =');
b3=input('enter the no of boxes sold for store 3 for #apple,#orange,#pears,#plums =');
b=[b1;b2;b3];
g=b*gain;%gross profit at each store
profit=sum(g); %total profit of all stores
TB=sum(b); %total boxes sold
T = array2table(b,'RowNames',{'store 1','store 2','store 3'},'VariableNames',{'apple','orange','pears','plums'})
disp('total no of boxes sold at all stores');
disp('#apple,#orange,#pears,#plums=');
disp(TB);
disp('profit at each store');
disp('store 1,store 2,store 3=');
disp(g');
disp('total profit=');
disp(profit);

2)matlab result for some random sale

enter the no of boxes sold for store 1 for #apple,#orange,#pears,#plums =[4 5 6 7]
enter the no of boxes sold for store 2 for #apple,#orange,#pears,#plums =[3 5 8 9]
enter the no of boxes sold for store 3 for #apple,#orange,#pears,#plums =[9 8 6 7]

T =

3×4 table

apple orange pears plums
_____ ______ _____ _____

store 1 4 5 6 7
store 2 3 5 8 9
store 3 9 8 6 7

total no of boxes sold at all stores
#apple,#orange,#pears,#plums=
16 18 20 23

profit at each store
store 1,store 2,store 3=
23.4500 26.8500 31.6000

total profit=
81.9000

Add a comment
Know the answer?
Add Answer to:
Vle/content/731186/fullscreen/3876261/View n3x You are the owner of three small grocery stores in your city. You want...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • by java langage QI A small online grocery store sells fruits with the following prices: Apple,...

    by java langage QI A small online grocery store sells fruits with the following prices: Apple, 1.500 KWD; Orange, 0.700 KWD; Banana, 1.000 KWD; Peach, 2.500 KWD; and Melon, 1.750 KWD. Write an application that reads a series of pairs of values as follows: 1. fruit name 2. quantity sold Your program should use a switch statement to determine the price for each fruit. It should then calculate and display the total retail value of all sold fruits (e.g., if...

  • You are the owner of a small chain of bookstores. To catalog your inventory, create a...

    You are the owner of a small chain of bookstores. To catalog your inventory, create a list of at least 25 books using an Excel table. Include the title, author, category and price. Choose one of the available table formats. When finished adding books, sort your list by category. Add relevant WordArt to your worksheet. Name this worksheet “Inventory”. Save your workbook with the name: Odd_Books_ltd.xls. Add a new worksheet that lists total sales by store for each quarter. Include...

  • Sample Scenario: You are a small business owner who is seeking to grow your business's revenue....

    Sample Scenario: You are a small business owner who is seeking to grow your business's revenue. You own a bakery, called The Barkery, specializing in making homemade and nutritious dog treats. You make the treats yourself, you manage the small brick-and-mortar shop when it's open, and with what time is left, you go into the community to increase brand awareness. Currently you are considering hiring a part-time salesperson who will focus on a reseller channel (indirect sales channel): Business-to-consumer (direct...

  • Need help with C++ assignment Assignment 1 and .txt files are provided at the bottom. PART...

    Need help with C++ assignment Assignment 1 and .txt files are provided at the bottom. PART A PART B Assignment 1 #include <iostream> #include <string> #include <fstream> #include <iomanip> #include <stdio.h> #include <ctype.h> #include <string.h> #include <algorithm> using namespace std; /** This structure is to store the date and it has three integer fields **/ struct Date{    int day;    int month;    int year; }; /** This structure is to store the size of the box and it...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT