2.0 Chapter Goals

The purpose of this chapter is to turn the theoretical considerations of chapter one into some practical realizations to put some flesh on the ideas of problem solving by using Modula-2 as the program writing notation. A simple program that writes a message to the screen is given first, and its parts are analyzed carefully. Following this, the technique of problem solving is elaborated with additional examples in Modula-2. On completing the chapter, the student should understand and be able to use the following:

Data Representation Abstractions

General:

No new data types are taken up in chapter 2.

Realized in the Modula-2 notation:

cardinal, integer, character, real, longreal, and literal strings

Data Manipulation Abstractions

General:

variable initialization

Realized in the Modula-2 notation:

variables, constants, literals, declaration, naming, assignment, expressions, type, type compatibility, type conversion, input and output, formatting of output.

Programming Abstractions

General:

No new programing abstractions are taken up in chapter 2. Several of the ones introduced in Chapter one are discussed further. Planning, refining, coding, and documentation of programs are elaborated.

Realized in the Modula-2 notation:

statement, repetition (while loop,) computer program, importing from libraries of pre-written routines (input and output,) commenting.


Contents