Question

Write a graphics python program!!!!!!! to calculate the cost per square inch of a circular pizza...

Write a graphics python program!!!!!!! to calculate the cost per square inch of a circular pizza and use graphics .py libaray!!!!! . Accept as input the diameter (in inches) and pizza price. Print the cost per square inch. If the cost per square inch is more than $.10 print a message that informing the user that this pizza is too expensive. Otherwise let the user know this is a good deal! and name it pizza.py.....This is a PYTHON language!!!!!!!!!!

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

from math import pi

price = float(input('Enter price: '))

diameter = float(input('Enter diameter in inches: '))

area = pi*(diameter/2)**2

cost_per_square_inch = price/area

print('Cost per square inch is $%.2f' % cost_per_square_inch)

if cost_per_square_inch > 0.1:

    print('The pizza is too expensive')

else:

    print('Buy it. It\'s a good idea!')

OUTPUT:----

Add a comment
Know the answer?
Add Answer to:
Write a graphics python program!!!!!!! to calculate the cost per square inch of a circular pizza...
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
  • Write a graphics program to calculate the cost per square inch of a circular pizza and...

    Write a graphics program to calculate the cost per square inch of a circular pizza and use graphics .py libaray. Accept as input the diameter (in inches) and pizza price. Print the cost per square inch. If the cost per square inch is more than $.10 print a message that informing the user that this pizza is too expensive. Otherwise let the user know this is a good deal! and name it pizza.py

  • Write a Python program that will prompt a user for the size of their (round) pizza...

    Write a Python program that will prompt a user for the size of their (round) pizza and will output the number of square inches in the pizza. it should be have comment block about date

  • Given the radius, in inches, and price of a pizza, write a program to find the...

    Given the radius, in inches, and price of a pizza, write a program to find the price of the pizza per square inch. Use float data type and format to 2 decimal places. You must have a $ sign for the price per square inch. Use math.pi to get the value if PI.   To do this use: import math PI = math.pi And then use PI to calculate area of pizza. Name your file ws3part1.py. Read the style guidelines before...

  • python - Write a program that converts square feet to square yards. Prompt the user to...

    python - Write a program that converts square feet to square yards. Prompt the user to enter a value in square feet and then print the converted output along with a message similar to "1 sq. ft. is .11111 sq. yards."

  • (The file should have your program and the console input/output of your program) 3.18: Pizza Pi...

    (The file should have your program and the console input/output of your program) 3.18: Pizza Pi Joe’s Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. The program should perform the following steps: Ask the user for the diameter of the pizza in inches. Calculate the number of slices that may be taken from a pizza of that size. Display a message telling the number of slices. To calculate...

  • Murphy Pizza Palace needs an application to calculate the number of slices of a pizzaof any...

    Murphy Pizza Palace needs an application to calculate the number of slices of a pizzaof any size can be divided into. The application should do the following: Allow the user to enter the diameter of the pizza, in inches. Calculate the number of slices that can be cut from a pizza that size. Display a message that indicates the number of slices. To calculate the number of slices that can be cut from the pizza, you must know the following...

  • In python using a def main() function, Write a function that will print a hello message,...

    In python using a def main() function, Write a function that will print a hello message, then ask a user to enter a number of inches (should be an integer), and then convert the value from inches to feet. This program should not accept a negative number of inches as an input. The result should be rounded to 2 decimal places(using the round function) and printed out on the screen in a format similar to the example run. Use a...

  • Write a program(Python language for the following three questions), with comments, to do the following:   ...

    Write a program(Python language for the following three questions), with comments, to do the following:    Ask the user to enter an alphabetic string and assign the input to a variable str1. Print str1. Check if str1 is valid, i.e. consists of only alphabetic characters. If str1 is valid Print “<str1> is a valid string.” If the first character of str1 is uppercase, print the entire string in uppercase, with a suitable message. If the first character of str1 is...

  • A restaurant called Tony’s Pizza Palace needs a program to help calculate rhe number of slices...

    A restaurant called Tony’s Pizza Palace needs a program to help calculate rhe number of slices a pizza of any aize can be divided into, and hoe many pizzas should be ordered for a party. The program will assume each person at the party will eat 3 slices of pizza each. The program should prompt the user for the diameter of the pizzas they wish to order. it will also ask the user for the number of people who will...

  • Python Simple Programming Write a program in Python that calculates the tip and total for a...

    Python Simple Programming Write a program in Python that calculates the tip and total for a meal at a restaurant. When your program is run it should ... Calculate the tip and total for a meal for a restaurant Print the name of the application "Tip Calculator" Get input from the user for cost of meal and tip percent Print the tip and total amounts. The formula for calculating the tip amount is: tip = cost of meal * (tip...

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