CSE 1010 Lecture Notes - Lecture 6: Local Variable, Free Variables And Bound Variables

30 views4 pages
jadetortoise401 and 55 others unlocked
CSE 1010 Full Course Notes
84
CSE 1010 Full Course Notes
Verified Note
84 documents

Document Summary

Week 4 - lecture 6 - user-designed functions. A function is a way to group statements together and give them a name. It collects all the steps into one convenient place. Don"t refer to a recipe by its ingredients and steps. Instead you refer to it by its name. You solve a small piece of a problem once and then turn it into a function. Then you can use it whenever and wherever you want. Then other programmers have access to that solution and can refer to it by name instead of re-solving the problem. No language has all the built-in functions that you"d ever need, so every language gives you the ability to create your own functions. Make you own functions in order to write well-designed programs. Name can be any valid identifier(i. e. , same as a variable name) Parameters are unknowns(use none if there is no need; still need parentheses) Body can be any group of statements.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents