You are on page 1of 4

print "What is your name?

"
name = raw_input()
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 or Square"
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 Rectangular Prism"
print "12. Find Volume or Surface Area of a Cone"
print "13. Find Volume or Surface Area of a Sphere"
print "14. Find Volume or Surface Area of a Cylinder"
print "15. Square Root"
print "*" * 52
print "Hi,", name
option = input ("Please Make A Selection: ")
print "Good Choice,", name
if option == 1:
firstnumber = input("Please Enter 1st Number: ")
secondnumber = input("Please Enter 2nd Number: ")
add = firstnumber + secondnumber
print firstnumber, "added to", secondnumber, "equals", add
print "Hope That Helps,", name
elif option == 2:
firstnumber = input ("Please Enter 1st Number: ")
secondnumber = input ("Please Enter 2nd Number: ")
multiply = firstnumber * secondnumber
print firstnumber, "multipled by", secondnumber, "equals", multiply
print "Hope That Helps,", name
elif option == 3:
firstnumber = input ("Please Enter 1st Number: ")
secondnumber = input ("Please Enter 2nd Number: ")
subtract = firstnumber - secondnumber
print firstnumber, "subtracted by", secondnumber, "equals", subtract
print "Hope That Helps,", name
elif option == 4:
firstnumber = input ("Please Enter 1st Number: ")
secondnumber = input ("Please Enter 2nd Number: ")
divide = firstnumber / secondnumber
print firstnumber, "divided by", secondnumber, "equals", divide
print "Hope That Helps,", name
elif option == 5:
x = input ("Please Enter Your Base Number: ")
y = input ("Please Enter Your Exponent: ")
Answer = x ** y
print x, "to the power of", y, "equals", Answer
print "Hope That Helps,", name
elif option == 6:
print "1. Perimeter"
print "2. Area"
option = input ("Please Make A Selection: ")
if option == 1:
length = input("Please Enter Length: ")
width = input("Please Enter Width: ")
perimeter = length * 2 + width * 2
print "The perimeter of your rectangle is", perimeter
print "Hope That Helps,", name
if option == 2:
length = input("Please Enter Length:")
width = input("Please Enter Width:")
area = length * width
print "The Area Of Your Eectangle Is", area
print "Hope That Helps,", name
elif option == 7:
print "1. Perimeter"
print "2. Area"
option = input("Please Make A Selection: ")
if option == 1:
sidea = input("Please Enter Side 1: ")
sideb = input("Please Enter Side 2: ")
sidec = input("Please Enter Side 3: ")
perimeter = sidea + sideb + sidec
print "The Perimeter Of Your Rectangle Is", perimeter
print "Hope That Helps,", name
elif option == 2:
Height = input ("Please Enter Height: ")
Base = input ("Please Enter Base: ")
area = Height * (Base * .5)
print "The Area Of Your Triangle Is", area
print "Hope That Helps,", name
elif option == 10:
print "1. Volume"
print "2. Surface Area"
option = input ("Please Make A Selection" )
if option == 1:
length = input ("Please Enter Length Of A Side: ")
volume = length * length * length
print "Volume of the cube is", volume
print "Hope That Helps,", name
elif option == 2:
length = input ("Please Enter Length Of A Side: ")
surface = length * length
surfacearea = surface * 6
print "Surface Area Of The Cube Is", surfacearea
print "Hope That Helps,", name
elif option == 8:
import math
print "1. Circumference"
print "2. Area"
option = input("Please Make A Selection: ")
if option == 1:
radius = input ("Please Enter Radius Of Circle: ")
diameter = radius * 2
circumference = diameter * 3.14159265358979323846264338
print "The Circumference Of Your Circle Is", circumference
print "Hope That Helps,", name
if option == 2:
Radius = input ("Please Enter Radius Of A Circle: ")
Area = Radius * Radius * 3.14159265358979323846264338
print "The Area Of Your Circle Is", Area
print "Hope That Helps,", name
elif option == 15:
from math import sqrt
n = input ("Enter Number: ")
root = sqrt (n)
print "The Square Root Is: ", root
print "Hope That Helps,", name
elif option == 9:
print "1. Perimeter"
print "2. Area"
option = input("Please Make A Selection: ")
if option == 1:
side1 = input("Please Enter Side Length: ")
perimeter = side1 * 5
print "The Perimeter Of Your Pentagon Is", perimeter
print "Hope That Helps,", name
if option == 2:
side1 = input("Please Enter Side Length: ")
apothem = input ("Please Enter The Apothem: ")
perimeter = side1 * 5
area = perimeter * apothem * .5
print "The Area of your Pentagon is", area
print "Hope That Helps,", name
elif option == 12:
print "1. Volume"
print "2. Surface Area"
option = input ("Please Make A Selection: ")
if option == 1:
height = input ("Please Enter Height Of The Cone: ")
radius = input ("Please 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
print "Hope That Helps,", name
if option == 2:
radius = input ("Please Enter Radius Of The Cone: ")
slant = input ("Please 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
print "Hope That Helps,", name
elif option == 13:
print "1. Volume"
print "2. Surface Area"
option = input ("Please Make A Selection: ")
if option == 1:
radius = input ("Please 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
print "Hope That Helps,", name
if option == 2:
radius = input ("Please Enter Radius Of The Sphere: ")
radiuss = radius * radius
radiuspi = radiuss * 3.14159265358979323846264338
surface = radiuspi * 4
print "The Surface Area Of Your Sphere Is", surface
print "Hope That Helps,", name
elif option == 11:
print "1. Volume"
print "2. Surface Area"
option = input ("Please Make A Selection: ")
if option == 1:
sidea = input ("Please Enter First Side Length: ")
sideb = input ("Please Enter Second Side Length: ")
sidec = input ("Please Enter Third Side Length: ")
volume = sidea * sideb * sidec
print "The Volume Of Your Rectangular Prism Is", volume
print "Hope That Helps,", name
if option == 2:
sidea = input ("Please Enter First Side Length: ")
sideb = input ("Please Enter Second Side Length: ")
sidec = input ("Please Enter Third Side Length: ")
areaone = (sidea * sideb) * 2
areatwo = (sideb * sidec) * 2
areathree = (sidea * sidec) * 2
surfacearea = areaone + areatwo + areathree
print "The Surface Area Of Your Rectangular Prism Is", surfacearea
print "Hope That Helps,", name
elif option == 14:
print "1. Volume"
print "2. Surface Area"
option = input ("Please Make A Selection: ")
if option == 1:
radius = input ("Please Enter Radius: ")
height = input ("Please Enter Height: ")
radiussquared = radius * radius
radiusheight = radiussquared * height
volume = radiusheight * 3.14159265358979323846264338
print "The Volume Of Your Cylinder Is", volume
print "Hope That Helps,", name
if option == 2:
radius = input ("Please Enter Radius: ")
height = input ("Please Enter Height: ")
one = 2 * 3.14159265358979323846264338 * radius * height
two = 2 * 3.14159265358979323846264338 * (radius * radius)
surfacearea = one + two
print "The Surface Area Of Your Cylinder Is", surfacearea
print "Hope That Helps,", name
else:
print "That Is Not A Valid Option!"

You might also like