I have a CIS150AB , and I did an assignment, but I got a rep from my instructor like this :
I am not seeing module headers for each module or calls to execute them.
I dont know what is header module in speudocode. Please help me.
I'm not sure at all but perhaps he/she means info such as
__author__ = 'phuvinh1408'
__version__ = '0.0.1'
__date__ = '2019-11-01'
Or maybe he wants a docstring describing the module at the top?
I would ask your instructor for clarification, though.
So this is my speudo-code
Quote:#CIS150AB-Vinh doan
# Asignment #5
#business rule 1
# storeName = North / West / online
#business rule 2
# coffeeType = regular / decaf / latte
#business rule 3
# totalPrice > 0
#output
# Display storeName, coffeeType, totalPrice
start
#declaration
text storeName = ""
text coffeeType = ""
num pound = 0 #declare variable
const num PRICE = 1.25 # declare variable (price/pound)
num totalPrice = 0 #declare variable
#input
global storeName
global coffeeType
global totalPrice
while storeName != "North" and storeName != "West" and storeName != "online"
print " enter store name"
store into storeName # is store name
if storeName != "North"
print "invalid input... must be North"
end if
if storeName != "West"
print "invalid input... must be West"
end if
if storeName != "online"
print "invalid input... must be online"
end if
storeName = input "Store name (North / West / online )."
end while # end loop
while coffeeType != "regular" and coffeeType != "decaf" and coffeeType != "latte"
print " enter coffee type"
store into coffeeType # is coffee type
if coffeeType != "regular"
print "invalid input... must be regular"
end if
if coffeeType != "decaf"
print "invalid input... must be decaf"
end if
if coffeeType != "latte"
print "invalid input... must be latte"
end if
coffeeType = input "Coffee Type (regular / decaf / latte )"
end while # end loop
while pound <= 0 # if the pounds ordered less than 0
print " enter pound"
store into pound #var is pound
if pound <= 0
print "invalid input .... must be > 0 " # show a warning
end if
pound = input "Pound Ordered (num >0)"
end while # end loop
#processing
if pound <= 0 then
print "invalid input .... must be > 0 " # show a warning
else
totalPrice = pound * PRICE # price of the pounds ordered
end if
#output
display "Store Name" + storeName
display "Coffee Type" + coffeeType
display "Pound Ordered" + totalPrice
end
and this is a rule from my assignment :
Quote:Rules/Assumptions:
Logic should include all model logic created to this point but logic will now be placed in modules and called in the correct sequence to process three validated inputs and a calculation (lbs * 1.25).
and this one is his feedback for my code :
Quote:I am not seeing module headers for each module or calls to execute them.
This looks great for assignment 4 but I still see no headers.
I dont understand what he want me to do on my code. can you guy take a look and let mo know some ideas
phuvinh1408 Wrote:I dont understand what he want me to do on my code.
If you don't understand what your instructor wants you to do, you need to ask him as ichabod801 said above. I have students myself and they don't hesitate to ask if they don't understand what I want them to do. It is quite understandable.
Also note that it is not speudo-code but pseudo-code.
(Nov-02-2019, 06:20 AM)Gribouillis Wrote: [ -> ]If you don't understand what your instructor wants you to do, you need to ask him as ichabod801 said above.
I think this is especially true given that he wants "calls to execute them." I'm not sure what that would mean in the context of either my suggestion of a docstring or Gribouilis's suggestion of module level dunder variables.
Classes and dunder inits?