English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2. start
read customerRecord
perform discount ()
perform calculation ()
stop
perform discount ()
if quantityOrdered > 100 then
discount = .20
else
if quantityOrdered > 12 then
discount = .10
endif
endif
perform calculation ()
total = priceEach * quantityOrdered
total = total – discount * total
print total
return

2007-10-02 07:13:46 · 1 answers · asked by caleb 1 in Computers & Internet Programming & Design

1 answers

Well you are reading one customer record and then you stop!

You have the statement
perform discount()
but I don't see a discount routine. Unless the second perform discount() is supposed to be the routine. It has no indication of starting a routine and no indication of ending a routine. You have the full English language available to you when you write pseudo code. Don't waste any of it by trying to cut corners.

Process_Customers
open customer file
read customerRecord
do until EOF customerFile
do discount()
do calculation()
read customerRecord
enddo /*customerFile */
exit

discount()
discount=0
if quantityOrdered > 100 then
discount = .20
else
if quantityOrdered > 12 then
discount = .10
endif
endif
return

I will let you do the rest.

2007-10-02 08:05:59 · answer #1 · answered by AnalProgrammer 7 · 0 0

fedest.com, questions and answers