Please place your programs in seperate files named as described in the problem. Improperly named programs will not count. Turn in your files by placing them in the dropbox. Please be mindful of the late policy.
Correct | 80% |
Commented | 10% |
Attempted | 10% |
Create a python program named fruittest.py
that defines
the following functions:
isApple(fruit)
:
returns true if fruit is either 'apple' or 'Apple'isOrange(fruit)
:
returns true if fruit is either 'orange' or 'Orange'isAppleOrOrange(fruit)
:
returns true if fruit is an apple or an orangeBe certain to provide function documentation strings
Create a python program named fruitstand.py
that does the
following:
import
s fruittest
Create a python program named calc.py
that acts as a
very simple calculator.
+, -, log, sqrt
getOneArg()
and
getTwoArgs()
that ask the user for and return 1 and 2
arguments, respectively.result(res)
that prints out the
result as shown belowHere is a sample set of interactions (with ######## as the break in between different runs of the program):
Operation (+, -, log, sqrt): +
Argument 1: 5
Argument 2: 6
Result: 11.0
#######
Operation (+, -, log, sqrt): -
Argument 1: 5
Argument 2: 6
Result: -1.0
#######
Operation (+, -, log, sqrt): log
Argument: 5
Result: 1.60943791243
#######
Operation (+, -, log, sqrt): sqrt
Argument: 6
Result: 2.44948974278
#######
Operation (+, -, log, sqrt): frog
Invalid operation!