Say i wrote the following program which i didn't:
>>> # area calculations
>>>
>>> print "Welcome to the Area calculations program"
Welcome to the Area calculations program
>>> print "------------"
------------
>>> print
>>> # print out the menu:
>>> print "please select a shape:"
please select a shape:
>>> print "1 rectangle"
1 rectangle
>>> print "2 circle"
2 circle
>>>
>>> # get the users choice:
>>> shape = input("1 or 2")
1 or 21
>>>
>>> # calculate the area:
>>> if shape == 1:
height = input("please enter the height:")
width = input("please enter the width:")
area = height*width
print "the area is", area
else:
radius = input("please enter the radius:")
area = 3.14*(radius**2)
print "The area is", area
How would i actually be able to use this program? how do i use it?
2007-11-07
11:26:57
·
2 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design