Computer Programming/Procedural programming
From Wikibooks, the open-content textbooks collection
In procedural programming, the program is written as a collection of actions (a procedure) that are carried out in sequence, one after the other. The order is important.
A procedure is sometimes termed an algorithm.
An ingredient of procedural programming is the idea of state. The actions in a program change the value of data items, usually termed variables. As the program executes, the values of variables change. At any point in time the variables have a set of values, which is their state.
This book can be viewed as predecessor of object oriented programming. If one want to continue to learn object oriented, this book is good point to start.
Table of content:
0a. Preface. Functional programming and Object Oriented throw Java.
0b. Introduction. Hello world. Compilation. JVM. Program launch from notepad.
1. Primitive types. Why their are needed? Types in Java. Constants.
1a. String, StringBuffer, StringBuilder.
2. Arrays (Matrix, cinema). Two dimensional arrays. Many dimensional arrays. Dynamic allocation of the array on the triangle example.
3. Blocks. Scope and visibility.
4. Branching operators. Example with variable declaration. Table of OR, AND, NOT, non formal explanation.
5. if, if-else, if-else-if, switch, ?:. if-return-else-return.
6. Loops. Operator goto. Loops on assembly. Pseudo code.
7. for, while, do-while. Their equivalence.
8. Procedural and functions. Connection to math. Examples.
9. Functions (cont). Parameter pass by value and by reference.
10. Functions (cont). Why functions? Modularity, readability, re-use.
11. Induction. Recursion. Examples. Watching table.
12. Recursion (cont). How one should imagine it? Tail-recursion.