Hello all I am taking an intro to programming class and need any help I can get this is one of the exercises that I have to to and my answer is at the bottom if anyone can tell me if at least if I'm going in the right direction I would appreciate it.
Rewrite the following pseudocode so the discount decisions and
calculations are in a module.
start
if quantityOrdered > 100 then
discount = .20
else
if quantityOrdered > 12 then
discount = .10
endif
endif
total = priceEach * quantityOrdered
total = total - discount * total
print total
stop
This is what I came up with:
start
if quantityOrdered > 100 then
discount =.20 ()
else
if quantityOrdered > 12 then
discount = .10 ()
end if
end if
total = priceEach * quantityOrdered()
total = total - discount * total ()
print total()
stop
I came up with this because from what I read a module is
just breaking down problems into smaller units. So that
the programmer can understand what the end results should
be.
If I am wrong please let me know.

4
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by Nick Evan

All you did is put parentheses after some things?

hi people can you help me with this question.You are required to write the pseudocode and draw its flowchart.
write and draw an algorithm to enter the marks of 20 students.

declare students[20]
declare counter

while counter < 20
read studentname and store in array
counter++

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.