CMPSC 16 Chapter Notes - Chapter 4: Include Directive, Local Variable, Newtype

47 views5 pages
21 Oct 2018
School
Course
Professor

Document Summary

Chapter 4: procedural abstraction and functions that return a value. In writing a program, first design the method that the program will use and write out the method in plain english (algorithm) Then, break it down into subtasks and sub subtasks from there. Top-down design/stepwise refinement/divide and conquer: starting at the top and breaking a program into many smaller subtasks. Pros: program is easier to understand, test, debug, and maintain; different people can work on different parts. Argument: the value a function starts out with. Value returned: the value that a function computes. Sqrt(): calculates the square root of a number. Function call/function invocation: an expression consisting of the function name followed by arguments enclosed in parentheses; more than one argument, separated by commands. Can set the function call equal to a variable with the same type as the return type of the function. When using math functions, such as sqrt(), have to #include ".

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents