Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## GLOBALS
- # This section contains the program's global variables.
- DESIRED_BANNER_WIDTH = 70
- coderName = " "
- date = " "
- programName = " "
- Description = " "
- # This section is meant to call the functions "collectInputs", "displayBanner", and "displaySectHeaders" with no parameters.
- def main():
- coderName, date, programName, Description = collectInputs()
- displayBanner()
- displaySectHeaders()
- # This section is meant to ask the user for information. It needs to store the variables into the globals above.
- def collectInputs():
- coderName = input('Enter your name: ')
- date = input('Enter the date: ')
- programName = input('Enter the program name: ')
- Description = input('Enter short description: ')
- return coderName, date, programName, Description
- # This section is meant to display a line of asterisks, the number being the amount stored in the "DESIRED_BANNER_WIDTH" global variable.
- def displayStarLine():
- print ('*' * DESIRED_BANNER_WIDTH)
- # This section is meant to call function "displayStarLine", display the name of the section, then call "displayStarLine" again.
- def displaySectHeader():
- ## displaySectHeader('Constants', 'Variables', 'Input', 'Processing', 'Output')
- displayStarLine()
- print('\t', sectionName)
- displayStarLine()
- # This section is meant to call the function "discplayStarLine", display the user-input data, one per line, relying on global data, and then call "displayStarLine" again.
- def displayBanner():
- displayStarLine()
- print('\tCoder\t:', coderName)
- print('\tDate\t:', date)
- print('\tProgram :', programName)
- print('\tDescrip :', Description)
- displayStarLine()
- # This section is meant to call the function "displaySectHeader" several times, each time passing in a single string as an argument, denoting a major section ina typical program, e.g., “Input”
- def displaySectHeaders(Constants, Variables, Input, Processing, Output):
- displayStarLine()
- ## Constants, Variables, Input, Processing, Output = displaySectHeader()
- ## displaySectHeader('Constants', 'Variables', 'Input', 'Processing', 'Output')
- x = main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement