Chapter 2
From Plan to Program
2.0 Chapter Goals
2.1 Giving Birth--A First Modula-2 Program
2.2 The Anatomy of an Infant Program
2.2.1 What is a Module?
2.2.2 Reserved Words
2.2.3 Standard Library Tools
2.2.4 A Name for the Baby--Identifiers
2.2.5 Strings
2.2.6 Summary
2.3 How to Solve a Problem
2.3.1 Analysis
2.3.2 Planning and Refining a Solution
2.3.3 Data Tables and Sample I/O
2.3.4 Refining the Solution
2.3.5 Execution and Satisfaction
2.4 Documenting the Solution
2.4.1 External Documentation
2.5 Variables in Modula-2
2.5.1 Simple Variable Types
2.5.2 Standard Identifiers
2.6 Literals and Constants
2.6.1 Literals
2.6.2 Constants
2.7 Expressions for Constants and Variables
2.7.1 Precedence in Modula-2
2.7.2 Mixed Expressions and Modula-2
2.8 Simple Output Methods
2.9 REAL Variables
2.9.1 Real Operations
2.9.2 The Format of Real Output
2.10 Type Compatibility and REAL
2.11 Interactive Programs
2.12 An Extended Example (Bank Interest)
2.12.1 Input in non ISO Versions
2.13 Chapter Summary
2.14 Assignments
Programming Note--I/O In Non-Standard Modula-2
Contents