You are on page 1of 3

option = 1

while option != 0:
print "************MENU************"
print "1. Add Numbers"
print "2. Multiply Numbers"
print "3. Subtract Numbers"
print "4. Divide Numbers"
print "5. Exponents"
print "6. Find Perimeter or Area of a Rectangle"
print "7. Find Perimeter or Area of a Triangle"
print "8. Find Circumference or Area of a Circle"
print "9. Find Perimeter or Area of a Pentagon"
print "10. Find Volume or Surface Area of a Cube"
print "11. Find Volume or Surface Area of a Cone"
print "12. Find Volume or Surface Area of a Sphere"
print "13. Square Root"
print "*" * 28
option = input("Please make a selection: ")
if option == 1:
firstnumber = input("Enter 1st number: ")
secondnumber = input("Enter 2nd number: ")
add = firstnumber + secondnumber
print firstnumber, "added to", secondnumber, "equals", add
elif option == 2:
firstnumber = input ("Enter 1st number: ")
secondnumber = input ("enter 2nd number: ")
multiply = firstnumber * secondnumber
print firstnumber, "multipled by", secondnumber, "equals", multiply
elif option == 3:
firstnumber = input ("Enter 1st number: ")
secondnumber = input ("enter 2nd number: ")
subtract = firstnumber - secondnumber
print firstnumber, "subtracted by", secondnumber, "equals", subtract
elif option == 4:
firstnumber = input ("Enter 1st number: ")
secondnumber = input ("enter 2nd number: ")
divide = firstnumber / secondnumber
print firstnumber, "divided by", secondnumber, "equals", divide
elif option == 5:
x = input ("Enter your Base Number: ")
y = input ("Enter your Exponent: ")
Answer = x ** y
print x, "to the power of", y, "equals", Answer
elif option == 6:
print "1. Perimeter"
print "2. Area"
option = input ("Please make a selection: ")
if option == 1:
length = input("Enter length: ")
width = input("Enter width: ")
perimeter = length * 2 + width * 2
print "The perimeter of your rectangle is", perimeter
if option == 2:
length = input("Enter Length:")
width = input("Enter Width:")
area = length * width
print "The area of your rectangle is", area
elif option == 7:
print "1. Perimeter"
print "2. Area"
option = input("Please make a selection: ")
if option == 1:
sidea = input("Enter side 1: ")
sideb = input("Enter side 2: ")
sidec = input("Enter side 3: ")
perimeter = sidea + sideb + sidec
print "The perimeter of your rectangle is", perimeter
elif option == 2:
Height = input ("Enter height: ")
Base = input ("Enter base: ")
area = Height * (Base * .5)
print "The area of your triangle is", area
elif option == 10:
print "1. Volume"
print "2. Surface Area"
option = input ("Please make a selection" )
if option == 1:
length = input ("Enter length of a side: ")
volume = length * length * length
print "Volume of the cube is", volume
elif option == 2:
length = input ("Enter length of a side: ")
surface = length * length
surfacearea = surface * 6
print "Surface Area of the Cube is", surfacearea
elif option == 8:
import math
print "1. Circumference"
print "2. Area"
option = input("Please make a selection: ")
if option == 1:
radius = input ("Enter Radius of Circle: ")
diameter = radius * 2
circumference = diameter * 3.14159265358979323846264338
print "The Circumference of your circle is", circumference
if option == 2:
Radius = input ("Enter Radius of a Circle: ")
Area = Radius * Radius * 3.14159265358979323846264338
print "The Area of your Circle is", Area
elif option == 13:
from math import sqrt
n = input ("Enter root: ")
root = sqrt (n)
print "The Square Root is: ", root
elif option == 9:
print "1. Perimeter"
print "2. Area"
option = input("Please make a selection: ")
if option == 1:
side1 = input("Enter Side Length: ")
perimeter = side1 * 5
print "The Perimeter of your Pentagon is", perimeter
if option == 2:
side1 = input("Enter Side Length: ")
apothem = input ("Enter the Apothem: ")
perimeter = side1 * 5
area = perimeter * apothem * .5
print "The Area of your Pentagon is", area
elif option == 11:
print "1. Volume"
print "2. Surface Area"
option = input ("Please make a selection: ")
if option == 1:
height = input ("Enter Height of the Cone: ")
radius = input ("Enter radius of the Cone: ")
hp = height * 3.14159265358979323846264338
radiussqaured = radius * radius
almostvolume = hp * radiussqaured
volume = almostvolume / 3
print "The Volume of your Cone is", volume
if option == 2:
radius = input ("Enter radius of the cone: ")
slant = input ("Enter Slant Height of the cone: ")
base = radius * radius * 3.14159265358979323846264338
circumference = radius * 2 * 3.14159265358979323846264338
slantheight = circumference * slant * .5
surfacearea = slantheight + base
print "The Surface Area of your cone", surfacearea
elif option == 12:
print "1. Volume"
print "2. Surface Area"
option = input ("Please make a selection: ")
if option == 1:
radius = input ("Enter Radius of the Sphere: ")
radiuscubed = radius * radius * radius
radiusfourthirds = radiuscubed * 4
radiusthirds = radiusfourthirds / 3
volume = radiusthirds * 3.14159265358979323846264338
print "The Volume of your Sphere is", volume
if option == 2:
radius = input ("Enter Radius of the Sphere: ")
radiuss = radius * radius
radiuspi = radiuss * 3.14159265358979323846264338
surface = radiuspi * 4
print "The Surface area of your sphere is", surface
else:
print "That is not a valid option!"

You might also like