Python Forum
What is header module in speudo-code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is header module in speudo-code
#1
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.
Reply
#2
I'm not sure at all but perhaps he/she means info such as
__author__ = 'phuvinh1408'
__version__ = '0.0.1'
__date__ = '2019-11-01'
Reply
#3
Or maybe he wants a docstring describing the module at the top?

I would ask your instructor for clarification, though.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#4
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
Reply
#5
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.
Reply
#6
(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.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#7
Classes and dunder inits?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Review my code: convert a HTTP date header to a datetime object stevendaprano 1 2,009 Dec-17-2022, 12:24 AM
Last Post: snippsat
  How to run code again in module ? rajamani 2 912 Nov-10-2022, 02:38 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020