Top Down Programming
Calculate Interest over a period of 5 years
-
Pseudocode
-
Stepwise Refinement
-
Algorithm
-
Redefine Pseudocode
-
Write Program
-
Trace Program
-
Define a constant for the interest rate
-
Read in from the keyboard the starting dollar amount.
Nested Loop - Tax tip calculator:
-
Pseudocode
-
Refinement
-
Format the output
-
Heading
-
Write Program
-
Trace Code
-
Inner and Outer Loops
Structured Programming:
-
sequence - executing statements in order
-
selection - choosing one of two alternatives
-
iteration - repeating a series of instructions
Programming Style:
-
Comments
-
Meaningful Variable Names
-
Spacing and Indenting
-
Readable Output
-
Debug Printout - extra print statements
-
Avoid writing tricky code
-
Documentation