Homework 24 due Monday November 12 before class


Module luna.py

elapsed time = distance / speed

DISTANCE_IN_MILES_TO_MOON = 238900.0

h( 119.45 ) = 2000.0

h( 597.25 ) = 400.0


Module calc.py

19.5 + 5.25 = 24.75

12.5 - 6.5 = 6.0

12.5 * 4.5 = 56.25

10.0 / 2.25 = 4.444444444444445

1.0 @ 5.0 = None


Module eval.py

x1 = [ ]; y1 = [ ]

x2 = [ 3, 1, 4 ]; y2 = [ ]

x3 = [ ]; y3 = [2, 7, 8]

x4 = [ 3, 1, 4 ]; y4 = [1, 5, 1, 9]

f( x1, y1 ) = [ ]

f( x2, y2 ) = [ 3, 1, 4 ]

f( x3, y3 ) = [ 2, 7, 8 ]

f( x4, y4 ) = [ 3, 1, 4, 1, 5, 1, 9 ]


Module uate.py

x1 = [ 0, 1, 2 ]

x2 = [ 0, 4, 1, 2, 2, 1, 3, 6, 3, 3, 4 ]

x3 = [ ]

g( x1 ) = [ 0, 1, 2 ]

g( x2 ) = [ 0, 4, 1, 2, 3, 6 ]

g( x3 ) = [ ]


Module sigma.py

d1 = [ [ 0 ], [ 1, 2 ], [ 1, 2, 3 ], [ 0 ] ]

d2 = [ [ 1, 0, 1, 2, 2 ], [ 3, 0, 1, 1, 1, 0 ], [ 2 ], [ 0, 0, 1 ] ]

d3 = [ [ 3, 0, 3], [ 3, 0, 3, 0, 1], [ 1, 0, 2 ] ]

d4 = [ ]

s( d1 ) = 9

s( d2 ) = 15

s( d3 ) = 16

s( d4 ) = 0


Module trio.py

x1 = [ 0, -3, 0, -4, -2 ]

x2 = [ -3, 1, -2, 1, -3, -3, -2, -4, -1, -4 ]

x3 = [ 2, -1, 0, 3, 0, 3, -2, -2, -1, -4, 3, -4, 3, -1, 3 ]

x4 = [ ]

t( x1 ) = [ 3, 2, 0 ]

t( x2 ) = [ 8, 0, 2 ]

t( x3 ) = [ 7, 2, 6 ]

t( x4 ) = [ 0, 0, 0 ]