Question

In: Computer Science

c.Imagine that a company produces bottled lemonade. For this company, an order consists of: the number...

  • c.Imagine that a company produces bottled lemonade. For this company, an order consists of:
    • the number of required bottles and
    • the size of the bottles, with a choice from: ‘small’, ‘medium’ and ‘large’.

You can assume that the bottles in a single order are all of the same size.

Given an order, the problem is to calculate the number of litres of lemonade required to fill all the bottles for that order.

The number of litres required for a single bottle is calculated as follows: Multiply 0.9560 with 1, 2 or 3 depending on whether the bottle size is ‘small’, ‘medium’ and ‘large’, respectively.

  • i.Include your initial decomposition of the problem in your solution document using the chevron notation (> and >>) from the module materials.
  • ii.Include the algorithm for solving the problem in your solution document.

Part iii of this question involves writing one Python function definition.

iii.Provide a single Python function that implements the algorithm. Follow the instructions above for submitting code.

Your answer must be a translation of your algorithm from part c (ii), otherwise no marks will be awarded.

Solutions

Expert Solution

Solution:

C(i)

Take the total number of bottles required for the user

Take the size of the bottle required i.e small,medium,large

calculate the number of litres for each size

   if size is "small" then

>> output =number of bottles required *0.9560*1

if size is "medium" then

>> output =number of bottles required *0.9560*2

if size is "large" then

>> output =number of bottles required *0.9560*3

C(ii)

Step1:

Take the total number of bottles required for the user

Step2:

Take the size of the bottle required i.e small,medium,large

Step3:

if size is "small" then

output =number of bottles required *0.9560*1

Step4:

if size is "medium" then

output =number of bottles required *0.9560*2

Step5:

if size is "large" then

output =number of bottles required *0.9560*3

C(iii)

def solution(cou,sie):
    value=0.9560
    result=cou*sie*value
    return result
B_count=float(input("enter the number of required bottles:"))
size_string=input("enter the size small,medium or large:")
if(size_string=="small"):
    size=1.0
elif(size_string=="medium"):
    size=2.0
elif(size_string=="large"):
    size=3.0
print(size)
res=solution(B_count,size)
print(res)

Related Solutions

Halla Corporation produces and sells bottled water. The bottled water produced by the company is sold...
Halla Corporation produces and sells bottled water. The bottled water produced by the company is sold for 500 won per bottle, and the variable cost of producing and selling a bottle of bottled water is 300 won. Meanwhile, the fixed cost incurred in facility investment for the production and sale of the bottled water is 10 million won. Halla Corp. uses 40 million won in debt with an interest rate of 10 percent. Answer the following question. 1. Halla Corporation's...
Juicy Lemonade Company The Juicy Lemonade Company manufactures premium flavored organic lemonade. Management is ready to...
Juicy Lemonade Company The Juicy Lemonade Company manufactures premium flavored organic lemonade. Management is ready to close the books for the end of the first quarter in 2019 and your supervisor has presented you with the following information. a. Total sales in gallons of flavored lemonade for January 2019 through March 2019 are as follows: January 14,000 February 15,000 March 17,000 Each gallon of lemonade is packaged in eight 16 ounce bottles and sold in a case that sells for...
In order to expand its bottled water business, a local company is considering the acquisition of...
In order to expand its bottled water business, a local company is considering the acquisition of additional equipment. It plans to buy the equipment. The total cost of the equipment (as one initial payment at the beginning of the project) is $200,500. During the time span of its use, the equipment is expected to produce net cash inflows of $67,000 each year. The equipment is expected to be used for 4 years, then re-sold in the used-equipment market for $25,000....
UPSA Ltd is a company that produces fruit juice which is bottled and sold in crates....
UPSA Ltd is a company that produces fruit juice which is bottled and sold in crates. The normal annual level of production on which the fixed production overhead absorption is based is 120,000 crates. Production 145,000 crates Sales 112,000 crates Selling price GHS2,000 per crate Costs: Direct material GHS600 per unit Direct labour GHS520 per unit Variable overhead GHS250 per unit Fixed production overhead GHS1,820,000 Variable selling and distribution cost 10% of sales revenue Fixed selling and distribution cost GHS234,000...
Lolly Water Company makes lemonade. Lolly Water Company normally sells 34,000 bottles of lemonade for $4...
Lolly Water Company makes lemonade. Lolly Water Company normally sells 34,000 bottles of lemonade for $4 per bottle. The cost to manufacture the lemonade is $1.50 per bottle. Management of Lolly Water Company have undertaken some research and have determined that further processing of the lemonade could convert the product into raspberry-lemonade flavour. Lolly Water Company could sell the raspberry-lemonade for $5.50 per bottle and would incur variable processing costs to convert the lemonade to raspberry-lemonade of $1.50 per bottle....
The average number of gallons of lemonade sold during a baseball game is 20, with a...
The average number of gallons of lemonade sold during a baseball game is 20, with a standard deviation of 3 gallons. Assume the amount of lemonade sold is normally distributed. When a game is played, find the probability that the amount of lemonade sold is: A) If 10 games are played, find the probability that the mean amount of lemonade sold is less than 19 gallons
Consider an orange island economy that consists of only two companies: an orange company that produces...
Consider an orange island economy that consists of only two companies: an orange company that produces oranges and an orange juice company that purchases oranges from the orange company to produce orange juice. Their income statements in 2015 are as follows: Orange Company:    Wages paid to employees                           $15,000    Taxes paid to government                          $ 5,000 Sales revenue:              Oranges sold to public                        $10,000              Oranges sold to Juice Corp.                $25,000 Orange Juice Company:    Wages paid to employees                           $10,000...
Consider an orange island economy that consists of only two companies: an orange company that produces...
Consider an orange island economy that consists of only two companies: an orange company that produces oranges and an orange juice company that purchases oranges from the orange company to produce orange juice. Their income statements in 2015 are as follows: Orange Company:    Wages paid to employees                           $15,000    Taxes paid to government                          $ 5,000 Sales revenue:              Oranges sold to public                        $10,000              Oranges sold to Juice Corp.                $25,000 Orange Juice Company:    Wages paid to employees                           $10,000...
The number of lemonades sold from Kaylee's Lemonade stand are as follows: 35 28 28 26...
The number of lemonades sold from Kaylee's Lemonade stand are as follows: 35 28 28 26 34 33 29 29 35 24 26 28 28 31 29 28 26 30 27 34 33 31 28 34 34 21 31 28 35 21 Using the 2k rule, what is the optimum number of classes needed to create a frequency distribution: a. 7 b. 6 c. 4 d. 5 What is the median number of glasses sold? The most frequently observed value...
Nowjuice, Inc., produces bottled pomegranate juice. A planner has developed an aggregate forecast for demand for...
Nowjuice, Inc., produces bottled pomegranate juice. A planner has developed an aggregate forecast for demand for the next six months. Month            May                Jun                  jul                   Aug                 Sep                  oct Forecast          4000                4800                5600                7200                6400                5000 Use the following information to develop aggregate plans. Regular production cost          $ 10 per case Regular production capacity 5000 cases Overtime production cost       $ 16 per case Subcontracting cost                $ 20 per case Inventory cost                         $ 1 per case per month Beginning inventory              ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT