Question

In: Computer Science

Pizza analysis, lab3pr1.py You noticed that the menu of your favorite pizza chain store is rather...

Pizza analysis, lab3pr1.py You noticed that the menu of your favorite pizza

chain store is rather complicated. They offer a range of pizza size and price op-
tions, making it difficult to see what option offers the most pizza for your dol-
lars. So you decide to write program that calculates the cost per square inch

of a circular pizza, given its diameter and price, similar to how grocery stores
display cost-per-ounce prices. The formula for area is A = r

2 ∗ π. Use two func-
tions: one called area(radius) to compute the area of a pizza, and one called

cost per inch(diameter, price) to compute cost per square inch. Sample runs
of your program should look like this:

Please enter the diameter of your pizza, in inches: 20
Please enter its cost, in dollars: 20
The cost is 0.06 dollars per square inch.
>>>>
Please enter the diameter of your pizza, in inches: 8.5
Please enter its cost, in dollars: 12.99
The cost is 0.23 dollars per square inch.

Use the built-in Python function round(value, 2) to round the final cost-per-
inch value to two decimal points. Use import math and math.pi to get the value

of pi for area computation.

use python

Solutions

Expert Solution

from math import pi
def area(radius):
return radius*radius*pi

def cost_per_inch(diameter, price):
radius = diameter/2;
A = area(radius)
cost = price/A;
return round(cost,2)

diameter = float(input("Please enter the diameter of your pizza, in inches: "))
cost = float(input("Please enter its cost, in dollars: "))
print("The cost is {} dollar per square inch.".format(cost_per_inch(diameter,cost)))


Related Solutions

You are now the manager of your favorite grocery store. Your job is to improve the...
You are now the manager of your favorite grocery store. Your job is to improve the store aesthetics and products to make sure that more shoppers come in to shop. You are asked to come up with a regression analysis to answer this question: If you were to run a logistic regression analysis, what would your dependent variable be? What would the 1, 0 indicate?
You are now the manager of your favorite grocery store. Your job is to improve the...
You are now the manager of your favorite grocery store. Your job is to improve the store aesthetics and products to make sure that more shoppers come in to shop. You are asked to come up with a regression analysis to answer this question: What are the differences between how you would interpret the normal regression and logistic regression when it comes down to (i) fit of the model, (ii) results of the regression (IV)
As you go to your favorite retail store and you select the same-sized packaged for the...
As you go to your favorite retail store and you select the same-sized packaged for the price, compare the manufacturer’s brands and store brands. How much can you save by purchasing private label brands of this products? How would you compare the percentage of savings on different categories of merchandise? How did the various grocery stores selected by the class compare in terms of prices savings on their private label brands versus the national brand?
Duncan’s Pizzas is a chain of pizza stores. Pizzas are made fresh in-store, and then delivered...
Duncan’s Pizzas is a chain of pizza stores. Pizzas are made fresh in-store, and then delivered to customers by a fleet of drivers. The senior management team has identified the strategic priorities for the business as on-time delivery and product quality. Required: a) For each of the strategic priorities, suggest and explain three performance measures. b) If the company is successful in achieving challenging targets for these performance measures, will it also necessarily achieve high profitability? Explain your answer. (400...
Duncan’s Pizzas is a chain of pizza stores. Pizzas are made fresh in-store, and then delivered...
Duncan’s Pizzas is a chain of pizza stores. Pizzas are made fresh in-store, and then delivered to customers by a fleet of drivers. The senior management team has identified the strategic priorities for the business as on-time delivery and product quality. Required: a) For each of the strategic priorities, suggest three performance measures. b) If the company is successful in achieving challenging targets for these performance measures, will it also necessarily achieve high profitability? Explain your answer
Duncan’s Pizzas is a chain of pizza stores. Pizzas are made fresh in-store, and then delivered...
Duncan’s Pizzas is a chain of pizza stores. Pizzas are made fresh in-store, and then delivered to customers by a fleet of drivers. The senior management team has identified the strategic priorities for the business as on-time delivery and product quality. Required: a) For each of the strategic priorities, suggest three performance measures. b) If the company is successful in achieving challenging targets for these performance measures, will it also necessarily achieve high profitability? Explain your answer. (4 marks, maximum...
Problem Scenario You are the store manager for a regional supermarket chain. Your store employees are...
Problem Scenario You are the store manager for a regional supermarket chain. Your store employees are non-union and management intends to keep it that way. Recently, a local union has attempted to organize your employees to form a union. This incident was reported to top management at headquarters. You later received orders from headquarters to discharge or in the words of one senior manager “Get rid of all Union instigators immediately” from your store who have signed union authorization cards...
Week 9 Duncan’s Pizzas is a chain of pizza stores. Pizzas are made fresh in-store, and...
Week 9 Duncan’s Pizzas is a chain of pizza stores. Pizzas are made fresh in-store, and then delivered to customers by a fleet of drivers. The senior management team has identified the strategic priorities for the business as on-time delivery and product quality. Required: a) For each of the strategic priorities, suggest three performance measures. b) If the company is successful in achieving challenging targets for these performance measures, will it also necessarily achieve high profitability? Explain your answer. (4...
You are dining at your favorite restaurant and eating your favorite meal when you start to...
You are dining at your favorite restaurant and eating your favorite meal when you start to think about the digestion process (sorry to ruin your meal). Briefly explain this process when food enters your stomach then in your small intestine. Include the following terms/structures in your explanation: stomach; chyme; hydrochloric acid; 3 basic tasks of stomach; length of time in stomach; 3 structural parts of small intestine; describe what happens in the first 25 centimeters of the small intestine; role...
At your favorite bond store, you see the following prices: (a) One-year $100 zero selling for...
At your favorite bond store, you see the following prices: (a) One-year $100 zero selling for $95.2381 (b) Two-year 8% coupon $1000 par bond selling for $1000 (1) Assume that the pure expectations theory for the term structure of interest rates holds, no liquidity premium exists, and the bonds are equally risky. What is the imply one-year rate one years from now? (20 points; use exact formula for all questions) (2) If there is a liquidity premium of 0.5% for...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT