| | |
pseudocode
![]() |
•
•
Join Date: Oct 2006
Posts: 4
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- help writing pseudocode, PLEASE!!!! (C++)
- Pseudocode (Computer Science)
- Anyone know how to do PSEUDOCODE? (Computer Science)
Other Threads in the Computer Science Forum
- Previous Thread: Turing completeness
- Next Thread: 5 listings?
Views: 2311 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Computer Science
ai algorithm algorithms architecture assembly assignment assignmenthelp assignments binary bizarre bletchleypark blogging book brunel cern cheating-failed clueless code codebreaker compiler computer computers control conversion copyright cryptography data-base database development dfa dissertation dissertationtopic education extensions github givemetehcodez government graphics guidelines history homework homeworkassignment homeworkhelp ibm ideas impress info information insertion introductory itcontracts jobs language lazy lighthouse lincence linkbait marketing method mobileapplication ms nerd networkingprojects news notation offtopic openoffice os parser problem programming project ps3 quick recursion result sam-being-cute science security servers skills software sorting spoonfeeding sql sql-server stephenfry student student-gets-caught supercomputing syntactic telecom time traffic tree uk verify visualbasic writer ww2






