pseudocode

Reply

Join Date: Oct 2006
Posts: 4
Reputation: blancanyc69 is an unknown quantity at this point 
Solved Threads: 0
blancanyc69 blancanyc69 is offline Offline
Newbie Poster

pseudocode

 
0
  #1
Oct 16th, 2006
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
read customerRecord
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
read customerRecord ()
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,080
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 142
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: pseudocode

 
2
  #2
Oct 19th, 2006
All you did is put parentheses after some things?
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 1
Reputation: m.wangwe is an unknown quantity at this point 
Solved Threads: 0
m.wangwe m.wangwe is offline Offline
Newbie Poster

Re: pseudocode

 
0
  #3
Nov 15th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 3,317
Reputation: Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute Nick Evan has a reputation beyond repute 
Solved Threads: 337
Moderator
Featured Poster
Nick Evan's Avatar
Nick Evan Nick Evan is offline Offline
Cenosillicaphobiac

Re: pseudocode

 
0
  #4
Nov 16th, 2006
declare students[20]
declare counter

while counter < 20
read studentname and store in array
counter++
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Computer Science Forum


Views: 2311 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Computer Science
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC