Advertisement
Guest User

Project 3 draft

a guest
Dec 10th, 2024
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.19 KB | Software | 0 0
  1. ## GLOBALS
  2.     # This section contains the program's global variables.
  3. DESIRED_BANNER_WIDTH = 70
  4. coderName = " "
  5. date = " "
  6. programName = " "
  7. Description = " "
  8.  
  9.  
  10.  
  11.     # This section is meant to call the functions "collectInputs", "displayBanner", and "displaySectHeaders" with no parameters.
  12. def main():
  13.      coderName, date, programName, Description = collectInputs()
  14.      displayBanner()
  15.      displaySectHeaders()
  16.  
  17.  
  18.     # This section is meant to ask the user for information. It needs to store the variables into the globals above.
  19. def collectInputs():
  20.     coderName = input('Enter your name: ')
  21.     date = input('Enter the date: ')
  22.     programName = input('Enter the program name: ')
  23.     Description = input('Enter short description: ')
  24.     return coderName, date, programName, Description
  25.  
  26.  
  27.     # This section is meant to display a line of asterisks, the number being the amount stored in the "DESIRED_BANNER_WIDTH" global variable.
  28. def displayStarLine():
  29.     print ('*' * DESIRED_BANNER_WIDTH)
  30.  
  31.  
  32.      # This section is meant to call function "displayStarLine", display the name of the section, then call "displayStarLine" again.
  33. def displaySectHeader():
  34. ##    displaySectHeader('Constants', 'Variables', 'Input', 'Processing', 'Output')
  35.     displayStarLine()
  36.     print('\t', sectionName)
  37.     displayStarLine()
  38.  
  39.    
  40.      # 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.
  41. def displayBanner():
  42.     displayStarLine()
  43.     print('\tCoder\t:', coderName)
  44.     print('\tDate\t:', date)
  45.     print('\tProgram :', programName)
  46.     print('\tDescrip :', Description)
  47.     displayStarLine()
  48.  
  49.  
  50.      # 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”
  51. def displaySectHeaders(Constants, Variables, Input, Processing, Output):
  52.      displayStarLine()
  53. ##    Constants, Variables, Input, Processing, Output = displaySectHeader()
  54. ##    displaySectHeader('Constants', 'Variables', 'Input', 'Processing', 'Output')
  55.  
  56.  
  57.  
  58. x = main()
  59.  
  60.  
  61.  
  62.  
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement