faculty.ccri.edu/kallen/04Chapter.ppt
color=black>
Chapter 4
1
4
Writing a Complete Program
Programming Logic and Design, Second Edition, Comprehensive
4
Chapter 4
2
4
Objectives
After studying
Chapter 4, you should be able to:
Plan the mainline logic
for a complete program
Describe typical housekeeping
tasks
Describe tasks typically
performed in the main loop of a program
Describe tasks performed
in the end-of-job module
Chapter 4
3
4
Understanding the Mainline
Logical Flow Through a Program
Plan the Logic
Review : the output is
an inventory report
The report lists inventory
items along with the price, cost, and profit of each item
Write a program:
reads from an input file and produces a printed report KNOW AS procedural
program
Chapter 4
4
4
Print Chart for Inventory Report
Chapter 4
5
4
Understanding the Mainline
Logical Flow Through a Program
Procedural Program , when
the program executes, each instruction takes place one at a time following
your programs logic.
Chapter 4
6
4
Understanding the Mainline
Logical Flow Through a Program
The overall or mainline
logic of
almost every procedural computer program can follow a general structure
that consists of three distinct parts:
Performing housekeeping,
or initialization tasks.