Flowchart
Flowchart
Look at the program flowchart on the next slide, and answer the following questions:
(a) For what variables are values read as input ?
(b) What variables’ values are output ?
(c) What constants are used ?
(d) Simulate the execution of this algorithm, assuming the values shown below are
read as input for the first four variables named.
START
READ NAME,
ITEM, QTY,
PRICE
AMTOD =
QTY * PRICE
DISCOUNT =
AMTOD * .10
SUBBILL =
AMTOD - DISCOUNT
TAXES =
SUBBILL * .05
BILL =
SUBBILL + TAXES
WRITE NAME,
ITEM, BILL
STOP
Exercise 3’s solution: (Part 1: System 6
Flowchart)
NAME, NUM,
SALES
WEEKLY
PAYROLL
PROGRAM
NAME, NUM,
PAY
7
Algorithm Development Process
Design verification, in order to:
– Prevent errors from occurring
– Detect and correct errors soon