Unit 7 Lesson 2 Parameters and Return Investigate
Unit 7 Lesson 2 Parameters and Return Investigate
Prompt:
Are clean and organized programs more useful for computers or people?
Why?
Try to give examples from programs you've written or seen in this class.
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?
symbol
3. What types of data does the parameter require in the calculate() function? Where can you find that
information?
It requires the symbol
4. What is returned? What type of data?
The string
Do This:
● Look at lines 30-36. Look at how the MOD operator % works. Watch the video walk-through about MOD.
Modify: Make these changes to the code
Level 3 - Follow the instructions, for discussion, add your thoughts here then do the modifications
● 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: