Question: Question : 1. Please answer the follwing questions using Python 3. Also, please show all outputs, and share code. Please do not do by hand.
Question: 1. Please answer the follwing questions using Python 3. Also, please show all outputs, and share code. Please do not do by hand. and answer any questions. Explain you code.
Problem 1. Revenue models.
You're an analyst for Farm2Table, a chain restaurant that sources its food locally whenever possible. You are tasked to forecast the financial payoff of an ad campaign.
Currently, average monthly revenue at each store is $100,000, with a standard deviation of $12,000. An advertising firm claims that with clever advertisement, they can increase monthly revenue for Farm2Table to $120,000, but the standard deviation will be increased as well, to $25,000. Assume a normal distribution.
Write a Python function simulate_revenue(average, std_dev, months).
it produces simulated revenue data according to a normal distribution with shape parameterized by average and std_dev, for a given number of months.
It returns a list of length months.
Round each item to the nearest cent. No fractions of a cent allowed.
Use simulate_revenue to generate two lists of random numbers which model potential revenue:
one list before with 24 months of revenue using the current mean and standard deviation,
another list after with 12 months of revenue using the predicted mean and standard deviation.
Then, concatenate before and after to produce a third list all_months containing the revenue of all 48 months.
Write a function print_monthly_revenue(revenue, name) that prints an arbitrary list to the screen, with these formatting requirements:
round each number when printing to the nearest $100.
do not modify the original list.
prints a two-column output, with month: revenue (the month is implicitly given). Pad the month value so it is always of width 2.
right-align the revenue value
Example: print_monthly_revenue(before, "before") produces
Revenue for period 'before' Mo: revenue ----------- 01: 123100 02: 98288 ...
Call print_monthly_revenue on each of your concatenated list, and be sure to commit the output.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
