Week 5 Homework
More practice with for loops and if statements
More practice with using functions as inputs to other functions
More practice writing functions
Whenever you create a function, you must decide what goes into the function and what
goes into the calling script. For example, do you pass gravity in as a variable or do you
just set it in the function?
Document your choices.
There is more than one right way to answer these homework problems. If you come up
with a different answer than your fellow classmates, discuss the relative merits of each
answer (is it clear? Is it more/less generalizable?)
Specific Coding Notes:
Set a break point at the first line of your function file. This way, you can see what
happens in the function file. First, check that the parameters that got passed in have the values
you expect. Second, make sure the output variable(s) are set correctly.
[20%] Comments and
Declared units on all variables?
English description of problem at top?
Comments outlining your steps?
[10%] Output formatting
Used fprintf() to make complete sentences
Correct units on answers?
Correct number of decimal places?
Script computes correct value(s)?
Correctly converted units in script when needed?