Structured Programming 2 - Class Example Code
- Students work with structured programming constructs by adding the selection and iteration program control flow mechanisms to their programming repertoire. They write structured algorithms and programs that use blocks of code to introduce an element of modularity into their programming practice.
- This is an introductory level computing science module with a prerequisite of Structured Programming 1.
- The files linked below contain examples of code, code "snippets" and the "proto code" used as the basis for summative assessments from class.
- Code is in both Portable Document Format (PDF) and Processing Development Environment (PDE) formats.
- Timeline: Monday April 4th to Friday May 6th
Entering Data In Programs
|
|
|
|
|
|
|
|
|
|
|
|
There are Postscript Errors in the last four programs directly above. The PDF versions of their code contain '0' which should be replaced with '0' and '9' should be replaced with '9' within the void keyPressed( ) portion of the programs in order to compile correctly.
Entering Strings In Programs
|
|
|
|
|
|
|
|
|
|
Rotating Shapes in Programs
|
|
|
|
|
|
Incorporating Images In Programs (Images used must be included in program folders for images to display.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Adding Sound To Programs (Sound files used must be included in program folders and libraries must be installed for sound to work.)
|
|
|
|
|
|
|
|
|
|
|
|
Advanced Text In Programs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|