ENG 1002 Lecture Notes - Code Reuse, Unit Testing, Software Projects

8 views4 pages

Document Summary

A function is a code bundled together and given a specific name. Whereas variables store stat with a given name. they sort this data in a box in the computer memory. Functions store their cod in a box in another part of the computer memory. Paratmer- the type of value which the function is expecting. Argument- also known as return variables they are what are trying to get back from the function. It is referred to the actual value which we are giving it. Note: multiple entries of variables and parameters are separated with commas. Start with the name of the function. To call a function named greetings: greetings( ), hi david, how are you today. At the end of the function, the program is returned where it was before the function was called. Programming languages come with a large collection of functions (called a library) for general-purpose tasks. E. g. input, disp, fprintf, sin, cos, atan, plot, clear, help.