SHARE
TWEET

Untitled

a guest Sep 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #
  2. #CGS 2060 - Fall Semester 2019
  3. #
  4. #Homework #1: Hospital emergency room data entry
  5. #
  6. #Cody Lemay
  7. #
  8. #
  9. lastName = input("Enter last name:")
  10. firstName = input("Enter first name:")
  11. middleInitial = input("Enter middle initial:")
  12. streetAddress = input("Enter in street address:")
  13. city = input("Enter city:")
  14. state = input("Enter state:")
  15. zipCode = input("Enter zip code:")
  16. gender = input("Enter gender:")
  17. dateOfBirth = input("Enter date of birth:")
  18. insurance = input("Are you insured?")
  19. ssn = input("Enter social security number:")
  20. age = 2019 - int(dateOfBirth[6]+dateOfBirth[7]+dateOfBirth[8]+dateOfBirth[9])
  21. #these will serve as my variables throughout my program
  22. #now that my variables are set in place, the first step will be to establish age restrictions using if statements to st up numeric boundaries
  23. if age < 18:
  24.     guardianFirstName = input("Guardian's first name:")
  25.     guardianLastName = input("Guardian's last name:")
  26.     fullGuardianName = guardianLastName + ", " + guardianFirstName
  27.     #guardians names will now be listed as one combined name
  28. elif age > 65:
  29.     medacaidID = input("Enter Medacaid ID:")
  30. #now people under 18 and over 65 will be able to provide the additional information required
  31. fullAddress = "%s %s %s %s" % (streetAddress, city, state, zipCode)
  32. newDateOfBirth = dateOfBirth[6] + dateOfBirth[7]+dateOfBirth[8]+dateOfBirth[9]+"-"+dateOfBirth[0]+dateOfBirth[1]+"-"+dateOfBirth[3]+dateOfBirth[4]
  33. newSsn = ssn[10] + ssn[9] + ssn[8] + ssn[7] + ssn[6] + ssn[5] + ssn[4] + ssn[3] + ssn[2] + ssn[1] + ssn[0]
  34. newName = firstName + " " + middleInitial + " " + lastName
  35. #these strings will program the file to follow assignment directions for information
  36. #the patients age will now be printed
  37. print("Date of birth: %60s" % newDateOfBirth)
  38. print("Age: %70s" % age)
  39. print("Name: %69s" % newName)
  40. print("Gender: %68s" % gender)
  41. print("Address: %66s" % fullAddress)
  42. print("Insurance: %64s" % insurance)
  43. print("SSN: %70s" % ssn)
  44. print("Encrypted SSN: %60s" % newSsn)
  45. if age < 18:
  46.     print("Guardian's full name: 55s" % fullGuardianName)
  47. elif age > 65:
  48.     print("Medicaid ID: %62s" % medacaidID)
  49. #these print commands will allow information to be displayed when the program is run
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top