Professional Documents
Culture Documents
CSP U7L2 Activity Guide
CSP U7L2 Activity Guide
Review
● Functions with parameters and return values help us simplify our code
● Functions can only return one value at a time
● A function can have:
○ No parameters and no return values
○ Parameters, but no return values
○ Return values, but no parameters
○ Parameters and return values
Level 2 - Follow the instructions, for discussion, add your thoughts here then do the modifications
2. What are the arguments passed through the parameter in calculate() when it is called?
3. What types of data does the parameter require in the calculate() function? Where can you find that
information?
Do This:
● Look at lines 30-36. Look at how the MOD operator % works. Watch the video walk-through about MOD.
Level 3 - Follow the instructions, for discussion, add your thoughts here then do the modifications
1. Lines 1 - 14: Read the code carefully. What is happening here?
2. Read the function on lines 15-34 carefully. After you are done, explain how the function works,
what parameters it takes and what is returned.
● Remove the letter dropbox and replace it with an input box. Update the code so the user
can type any number of letters, and only words that start with those letters and are the
specified length will be displayed.
Takeaways: