Reference no: EM132356419
Exercise: Pizza
Topics
-Types of variables
-Manipulating the input from the user
-Writing formulas - Order of precedence
-Documenting your progam
Write a program that lets a user find out their cost per square inch of pizza and the pizza's total cost with and without sales tax. The program should allow the user the enter a pizza diameter, a price, and a state sales tax percentage. The program should return the cost per square inch, and the total cost of the pizza with and without sales tax.
a. Determine what variables you will use. List their names and types. Plan out your program before you start.
b. Implement your program in Python.
# Author: <Your name>
# Date: June 20, 2017
# Program Name: YourNameL2.py
# Purpose: This program accepts a diameter in inches, pizza price,
# and, sales tax and returns the cost per square inch of pizza both
# with and without sales tax
Also, include comments within code. For example, r = d/2 #getting the radius from the diameter
Sample run output:
Welcome to the pizza calculator!
Enter the pizza diameter in inches: 12.5
Enter the price of the pizza: 7.98
Enter the state sales tax as a decimal: .08
The pizza cost with sales tax is $ 8.62
The cost per square inch without sales tax is $0.065
The cost per square inch with sales tax is $0.070