Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview Abby has always dreamed of having her own ice cream shop. Now as a young entrepreneur she has decided to pursue her dream, but

Overview

Abby has always dreamed of having her own ice cream shop. Now as a young entrepreneur she has decided to pursue her dream, but she needs some help in determining the financial viability of her plan. She has come up with a list of income and expense parameters and needs a simple program to input these parameters and calculate the monthly profit or loss as well as performing some variable cost what-if analysis.

What you need to know

For expenses, she has:

  • Raw ingredient cost per serving
  • Hourly labor rate
  • Real estate monthly rental
  • Utilities per month
  • Monthly advertising budget

On the income side, she has:

  • Selling price per serving (assume only one size for simplicity)
  • Number of servings sold per month

Based on some research, she has determined that a single employee can run the shop and she plans to have the shop open eight hours per day and six days per week.

image text in transcribed image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Hope that helps, thanks.

What you need to do Best Practices to Follow: 1. Write detailed comments and doc-strings. 2. Use logical variable names with a consistent convention. 3. Organize and structure your code for readability. 4. Use hand calculations to verify the formulas in your code. I.e. write your own test cases to check correctness. Create the text-based, menu interface Write a Python script with a menu driven, text-based user interface that looks like this: Expenses : 1. Cost per serving: 1.0 2. Labor rate per hour: 7.5 3. Shop rental per month: 800 4. Utilities per month: 150 5. Advertising budget per month: 100 Income: 6. Selling price (each): 4.0 7. Servings sold per month: 500 Analysis: Enter Selection ( to Exit): In which the current parameter value is displayed but the user can select and modify each one. For example: Enter Selection (o to Exit): 1 Enter cost per serving: Use the following as the default starting values: serving_cost = 1.00 labor_rate = 7.50 shop_rental = 800 utilities = 150 advertising = 100 servings_per_month = 1000 selling price = 4.00 Tasks Create the text based menu interface shown above using the default values. > The user can set the expenses from the menu > Add Profit/Loss functionality At this point, your script should allow the user to input values for all the variables needed to calculate the profit (or loss) of Abby's Ice Cream business. To add this functionality, start by adding the menu item 8. Profit/Loss Calculation under the Analysis section of the menu. If the user selects option 8, the script should display something like the following: Enter Selection (o to Exit): 3 The Ice Crean shop will have a monthly profit/loss of 90.6 or 0.18 per serving. In order to perform these calculations, you'll have to think back to Algebra and calculate things like the total expenses and the total income on a monthly basis. Finally, in order to keep the values in monetary precision, you can use the round() function with a precision of 2. Task Add profit/loss calculations Make it your own Add functionality that will that use the current expenses and sales volume but vary the sale price until the "break-even" point is found. If the initial calculation is positive then reduce the price iteratively and if negative, increase the price iteratively (think loop). Note: Your algorithm doesn't have to find the exact break-even point, only the point where it changes from negative to positive or positive to negative. This is the price where the shop "breaks even": 10. Find Break-Even Enter Selection (0 to Exit): 10 Break-Even occurs with a selling price of: 5.7 Task > This task will be manually graded by your instructor to check that the goals and the requirements for the task have been met. shop.py main.py x + 1 4 2 Part 1 : 3 Per the instructions, the problem prompts the user for the following information: Cost per ice cream serving 5 * Employee labor rate (per hour) 6 * Shop rental (per month) 7 * Utilities (per month) 8 * Advertising (per month) 9 * Selling price (each) 10 * ice cream servings sold per month 11 12 You program should operate in a loop in which a menu is displayed with the 13 following options: 14 15 16 Expenses : 17 1. Cost per serving: 18 2. Labor rate per hour: 19 3. Shop rental per month: 20 4. Utilities per month: 21 5. Advertising budget per month: 22 23 Income: 24 6. Selling price (each): 25 7. Servings sold per month: 26 27 Analysis: 28 8. Profit/Loss Calculation 29 9. "What If" analysis with 10% variance 30 31 Enter Selection ( to Exit): 32 33 34 Menu items 1 - 7 should display the current value of the category and allow 35 the user to change it. 36 37 Menu item 8 should disnlay a single value indicating the amount of nrofit or shop.py X main.py x + 37 Menu item 8 should display a single value indicating the amount of profit or 38 loss. It should then, while holding the income fixed, vary the expenses from 39 to + 10 percent in 2 percent increments and outputting the values and the 40 resulting profit or loss in a table. Finally, while holding the expenses 41 fixed, vary the income parameters from - to + 10 percent in 2 percent increments. 42 43 Sample Output: 44 Enter Selection ( to Exit): 8 45 The Ice Cream Shop will have a monthly profit/loss of 90.0 or 4.0 per serving. 46 47 Enter Selection ( to Exit): 9 48 Varying the Expenses +/- 10%: 49 Percent: -10 Expenses: 1719. Profit/Loss: 281.0 50 Percent: -8 Expenses: 1757.2 Profit/Loss: 242.8 51 Percent: -6 Expenses : 1795.4 Profit/Loss: 204.6 52 Percent : -4 Expenses: 1833.6 Profit/Loss: 166.4 53 Percent: -2 Expenses: 1871.8 Profit/Loss: 128.2 54 Percent: 0 Expenses: 1910.0 Profit/Loss: 90.0 55 Percent: 2 Expenses: 1948.2 Profit/Loss: 51.8 56 Percent: 4 Expenses: 1986.4 Profit/Loss: 13.6 57 Percent: 6 Expenses: 2024.6 Profit/Loss: -24.6 58 Percent: 8 Expenses: 2062.8 Profit/Loss: -62.8 59 Varying the Income +/- 10%: 60 Percent: -10 Income: 1800. Profit/Loss: -110.0 61 Percent: -8 Income: 1840. Profit/Loss: -70.0 62 Percent: -6 Income: 1880.0 Profit/Loss: -30.0 63 Percent: -4 Income: 1920.0 Profit/Loss: 10.0 64 Percent: -2 Income: 1960.0 Profit/Loss: 50.0 65 Percent: Income: 2000. Profit/Loss: 90.0 66 Percent: 2 Income: 2840.0 Profit/Loss: 130.0 67 Percent: 4 Income: 2080.0 Profit/Loss: 170.0 68 Percent: 6 Income: 2120.0 Profit/Loss: 210.0 69 Percent: 8 Income: 2160. Profit/Loss: 250.0 70 71 Bonus: 72 Add functionality that will that use the current expenses and sales volume but shop.py main.py x + 72 Add functionality that will that use the current expenses and sales volume but 73 vary the sale price until the "break-even" point is found. If the initial calculation 74 is positive then reduce the price iteratively and if negative, increase the price 75 iteratively (think loop). Note that your algorithm doesn't have to find the exact 76 break even point, only the point where it changes from negative to positive or 77 positive to negative 78 79 10. Find Break-Even 80 81 Enter Selection ( to Exit): 10 82 Break-Even occurs with a selling price of: 5.7 83 84 85 Note that in all these calculations, assume that the shop operates with a single 86 employee six days a week, eight hours per day. 87 88 11 B 89 90 # Tip: Always make constants ALL CAPS and give them descriptive names. Think about what 91 constants you will need in your script. I.e. what numbers will you use that are fixed? 92 93 94 95 96 Naming variables well is a best practice. While formats vary by developer/language, 97 "snake_case" is commonly used in Python. For example, a variable containing the cost 98 per serving of ice cream could be named serving_cost. Doing this consistently with a 99 consistent convention is one mark of a professional developer as it reduces the long Le term cost of software maintenance by creating "built in" documentation. 101 L02 What variables will you need? Start out by listing what the script needs (inputs) L03 and what the script will produce outputs). Hint: look at the sample menu. List those 184 out and you'll be well on your way. 105 106 107 107 18 108 109 Additional Hints: 110 You'll need some form of loop that the script will stay in until the user chooses option 111 @ to exit. In this loop, you'll want to print out the menu and prompt for user input. 112 In this way, everytime a selection is made, the work is done then the loop starts over 113 and refreshes the menu. Once the user wants to exit, just break out of the loop just like 114 learned in the text reading. 115 116 Next you'll need some logic to either update your variables or to calculate the requested 117 information. 118 119 IDE's support something called "breakpoints" which allow you to stop execution and examine the 120 of variables in the code. If you don't want to learn that yet then remember you can always put 121 extra "prints" to output intermediate values to test your algorithms. 122 123 Don't forget to comment your code. It's the perfect time to start a good habit! 124 125 What you need to do Best Practices to Follow: 1. Write detailed comments and doc-strings. 2. Use logical variable names with a consistent convention. 3. Organize and structure your code for readability. 4. Use hand calculations to verify the formulas in your code. I.e. write your own test cases to check correctness. Create the text-based, menu interface Write a Python script with a menu driven, text-based user interface that looks like this: Expenses : 1. Cost per serving: 1.0 2. Labor rate per hour: 7.5 3. Shop rental per month: 800 4. Utilities per month: 150 5. Advertising budget per month: 100 Income: 6. Selling price (each): 4.0 7. Servings sold per month: 500 Analysis: Enter Selection ( to Exit): In which the current parameter value is displayed but the user can select and modify each one. For example: Enter Selection (o to Exit): 1 Enter cost per serving: Use the following as the default starting values: serving_cost = 1.00 labor_rate = 7.50 shop_rental = 800 utilities = 150 advertising = 100 servings_per_month = 1000 selling price = 4.00 Tasks Create the text based menu interface shown above using the default values. > The user can set the expenses from the menu > Add Profit/Loss functionality At this point, your script should allow the user to input values for all the variables needed to calculate the profit (or loss) of Abby's Ice Cream business. To add this functionality, start by adding the menu item 8. Profit/Loss Calculation under the Analysis section of the menu. If the user selects option 8, the script should display something like the following: Enter Selection (o to Exit): 3 The Ice Crean shop will have a monthly profit/loss of 90.6 or 0.18 per serving. In order to perform these calculations, you'll have to think back to Algebra and calculate things like the total expenses and the total income on a monthly basis. Finally, in order to keep the values in monetary precision, you can use the round() function with a precision of 2. Task Add profit/loss calculations Make it your own Add functionality that will that use the current expenses and sales volume but vary the sale price until the "break-even" point is found. If the initial calculation is positive then reduce the price iteratively and if negative, increase the price iteratively (think loop). Note: Your algorithm doesn't have to find the exact break-even point, only the point where it changes from negative to positive or positive to negative. This is the price where the shop "breaks even": 10. Find Break-Even Enter Selection (0 to Exit): 10 Break-Even occurs with a selling price of: 5.7 Task > This task will be manually graded by your instructor to check that the goals and the requirements for the task have been met. shop.py main.py x + 1 4 2 Part 1 : 3 Per the instructions, the problem prompts the user for the following information: Cost per ice cream serving 5 * Employee labor rate (per hour) 6 * Shop rental (per month) 7 * Utilities (per month) 8 * Advertising (per month) 9 * Selling price (each) 10 * ice cream servings sold per month 11 12 You program should operate in a loop in which a menu is displayed with the 13 following options: 14 15 16 Expenses : 17 1. Cost per serving: 18 2. Labor rate per hour: 19 3. Shop rental per month: 20 4. Utilities per month: 21 5. Advertising budget per month: 22 23 Income: 24 6. Selling price (each): 25 7. Servings sold per month: 26 27 Analysis: 28 8. Profit/Loss Calculation 29 9. "What If" analysis with 10% variance 30 31 Enter Selection ( to Exit): 32 33 34 Menu items 1 - 7 should display the current value of the category and allow 35 the user to change it. 36 37 Menu item 8 should disnlay a single value indicating the amount of nrofit or shop.py X main.py x + 37 Menu item 8 should display a single value indicating the amount of profit or 38 loss. It should then, while holding the income fixed, vary the expenses from 39 to + 10 percent in 2 percent increments and outputting the values and the 40 resulting profit or loss in a table. Finally, while holding the expenses 41 fixed, vary the income parameters from - to + 10 percent in 2 percent increments. 42 43 Sample Output: 44 Enter Selection ( to Exit): 8 45 The Ice Cream Shop will have a monthly profit/loss of 90.0 or 4.0 per serving. 46 47 Enter Selection ( to Exit): 9 48 Varying the Expenses +/- 10%: 49 Percent: -10 Expenses: 1719. Profit/Loss: 281.0 50 Percent: -8 Expenses: 1757.2 Profit/Loss: 242.8 51 Percent: -6 Expenses : 1795.4 Profit/Loss: 204.6 52 Percent : -4 Expenses: 1833.6 Profit/Loss: 166.4 53 Percent: -2 Expenses: 1871.8 Profit/Loss: 128.2 54 Percent: 0 Expenses: 1910.0 Profit/Loss: 90.0 55 Percent: 2 Expenses: 1948.2 Profit/Loss: 51.8 56 Percent: 4 Expenses: 1986.4 Profit/Loss: 13.6 57 Percent: 6 Expenses: 2024.6 Profit/Loss: -24.6 58 Percent: 8 Expenses: 2062.8 Profit/Loss: -62.8 59 Varying the Income +/- 10%: 60 Percent: -10 Income: 1800. Profit/Loss: -110.0 61 Percent: -8 Income: 1840. Profit/Loss: -70.0 62 Percent: -6 Income: 1880.0 Profit/Loss: -30.0 63 Percent: -4 Income: 1920.0 Profit/Loss: 10.0 64 Percent: -2 Income: 1960.0 Profit/Loss: 50.0 65 Percent: Income: 2000. Profit/Loss: 90.0 66 Percent: 2 Income: 2840.0 Profit/Loss: 130.0 67 Percent: 4 Income: 2080.0 Profit/Loss: 170.0 68 Percent: 6 Income: 2120.0 Profit/Loss: 210.0 69 Percent: 8 Income: 2160. Profit/Loss: 250.0 70 71 Bonus: 72 Add functionality that will that use the current expenses and sales volume but shop.py main.py x + 72 Add functionality that will that use the current expenses and sales volume but 73 vary the sale price until the "break-even" point is found. If the initial calculation 74 is positive then reduce the price iteratively and if negative, increase the price 75 iteratively (think loop). Note that your algorithm doesn't have to find the exact 76 break even point, only the point where it changes from negative to positive or 77 positive to negative 78 79 10. Find Break-Even 80 81 Enter Selection ( to Exit): 10 82 Break-Even occurs with a selling price of: 5.7 83 84 85 Note that in all these calculations, assume that the shop operates with a single 86 employee six days a week, eight hours per day. 87 88 11 B 89 90 # Tip: Always make constants ALL CAPS and give them descriptive names. Think about what 91 constants you will need in your script. I.e. what numbers will you use that are fixed? 92 93 94 95 96 Naming variables well is a best practice. While formats vary by developer/language, 97 "snake_case" is commonly used in Python. For example, a variable containing the cost 98 per serving of ice cream could be named serving_cost. Doing this consistently with a 99 consistent convention is one mark of a professional developer as it reduces the long Le term cost of software maintenance by creating "built in" documentation. 101 L02 What variables will you need? Start out by listing what the script needs (inputs) L03 and what the script will produce outputs). Hint: look at the sample menu. List those 184 out and you'll be well on your way. 105 106 107 107 18 108 109 Additional Hints: 110 You'll need some form of loop that the script will stay in until the user chooses option 111 @ to exit. In this loop, you'll want to print out the menu and prompt for user input. 112 In this way, everytime a selection is made, the work is done then the loop starts over 113 and refreshes the menu. Once the user wants to exit, just break out of the loop just like 114 learned in the text reading. 115 116 Next you'll need some logic to either update your variables or to calculate the requested 117 information. 118 119 IDE's support something called "breakpoints" which allow you to stop execution and examine the 120 of variables in the code. If you don't want to learn that yet then remember you can always put 121 extra "prints" to output intermediate values to test your algorithms. 122 123 Don't forget to comment your code. It's the perfect time to start a good habit! 124 125

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions