Trial and Error
Create program, run it, alter code until desired result
Stepwise Refinement
Divide and Conquer
Breaks task into smaller parts
Modular Programming
Method Header
Method Body
Code of the method
Modifiers
Ex: public and static
public/private
Naming Conventions for Subroutine
Static
Ensures subroutine can exist on own and not as part of object
Local Variables Inside Subroutine
Program Control for Subroutine
Procedure
Performs task but doesn’t return data to main program; returns void
Data Transfer from Main Program to Subroutine
Write arguments in brackets in same order as parameters
Function
Return Types
Int, Double, String, Void, etc
void
Used when no data returned to main program
Return Statement
return (variable);
Outputting Data from Method Call
Methods
Declaring Parameter
Done while declaring subroutine
Declaring Argument
Done while calling subroutine
Declaring Variables on Same Line
Possible for same data type in the main program, not in subroutines
Subroutine Header
Comments explaining subroutine function, inputs and outputs, parameters passed, data returned (if any).