Advertisement
Guest User

Project 1

a guest
Apr 7th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.11 KB | None | 0 0
  1. Tyler Kinney & Ray Jasinski
  2.  
  3. #Ray and Tyler
  4. import time #Reseached online: http://stackoverflow.com/questions/510348/how-can-i-make-a-time-delay-in-python  #It is an import for time
  5. import math #Imports all the math code
  6. import random # imports all the random code.
  7.  
  8.  
  9. def schedual(): #Train Schedule Ray and Tyler
  10.   print "="*50
  11.   print ("  \t\t   T R A I N S")  
  12.   print ("="*50)
  13.   print(' \t  Train schedule to get to school')
  14.   print ( "="*50)
  15.   start = raw_input('\tType prep to continue: ')  
  16.   print "="*50
  17.   if start == 'prep':
  18.    print "What train line do you want to take Montclair booton or Hudson Bergen Lightrail",
  19.   print "="*50  #Code used in a pass assignment #Code from pass assigenment
  20.  
  21. def randomnumb(): #tyler
  22.   rannumber = random.choice([1,2,3,4,5,6])
  23.   while rannumber <= 0:
  24.     ranumber = rannumber + 1
  25.   print 'you rounded a the number %s' % rannumber,
  26.   print '',
  27.   print '',
  28.   main_menu1()
  29.  
  30. def train(): #This is the code for the train schedule Ray
  31.   train = raw_input()
  32.   if train == 'Montclair':
  33.      print ('Do you want to get to hoboken early, on time or late')
  34.   montclair = raw_input()
  35.   if montclair == 'early':
  36.      print 'Trains to hoboken are \n\ndepart 6:28am--7:00am arrives\ndepart 6:40am--7:17am arrives',
  37.      main_menu1()
  38.   elif montclair == 'on time':
  39.      print 'Trains to hoboken are \n\ndepart 7:08am--7:40am arrives',
  40.      main_menu1()
  41.   elif montclair == 'late' :
  42.      print 'Your going to get jub if you dont pick the first three 3 so any other trains dont matter.'
  43.      main_menu1()
  44.   if train == 'hudson bergen lightrail':
  45.      print ('Do you want to get to school early, on time or late')
  46.   hudson = raw_input()
  47.   if hudson == 'early':
  48.      print 'The trains to Marin are \n\ndepart 6:06am--6:22am arrives\ndepart 6:18m--6:34am arrives\ndepart 6:36am--6:52am arrives\ndepart 6:47am--7:03am arrives',
  49.      main_menu1()
  50.   elif hudson == 'on time':
  51.      print 'Trains to Marin are \n\ndepart 7:16am--7:32am arrives\ndepart 7:45am--8:01am arrives',
  52.      main_menu1()
  53.   elif hudson == 'late':
  54.      print ' Your going to get jug if you dont pick the first 6 so any other trains dont matter.'
  55.      main_menu1()
  56.   else:
  57.      print 'you didnt select a choice',
  58.      main_menu1()#code from passed assignment. #Code from pass assignment
  59.  
  60. def systemdi(): #tyler
  61.   loading()
  62. def calculator(): #Calculator Ray and Tyler
  63.   print '1. addiction' #all the options for the calculator.
  64.   print '2. subtraction'
  65.   print '3. multiplication'
  66.   print '4. division'
  67.   print '5. return to main menu'
  68.   calculatorRI = raw_input('choose one')
  69.   if calculatorRI == '1':
  70.     print add(),
  71.     calculator()
  72.   elif calculatorRI == '2':
  73.     print subtract(),
  74.     calculator()
  75.   elif calculatorRI == '3':
  76.     print Multiply(),
  77.     calculator()
  78.   elif calculatorRI == '4':
  79.     print divide(),
  80.     calculator()
  81.   elif calculatorRI == '5':
  82.     print 30*'-',
  83.     main_menu1()
  84.   else:
  85.     print 'not a option'
  86.  
  87. def loading(): #learned from jason davidoff #ray
  88.   print 'Loading'
  89.   time.sleep(1),
  90.   print 30*'-'
  91.   time.sleep(1)
  92.   print 'mouse connection:'
  93.   time.sleep(1)
  94.   print random.choice(['connected','disconnected','error'])
  95.   time.sleep(1)
  96.   print '\n'
  97.   time.sleep(1)
  98.   print 'internet connection:'
  99.   time.sleep(1)
  100.   print random.choice(['connected','disconnected','error'])
  101.   time.sleep(1)
  102.   print '\n'
  103.   time.sleep(1)
  104.   print 'keyboard connection :'
  105.   time.sleep(1)
  106.   print random.choice(['connected','disconnected','error'])
  107.   time.sleep(1)
  108.   print '\n'
  109.   time.sleep(1) #learned from Jason who showed me how to use the time code.
  110.   print 'Moniter:'
  111.   time.sleep(1)
  112.   print random.choice(['connected','disconnected','error'])
  113.   time.sleep(1)
  114.   print '\n'
  115.   time.sleep(1)
  116.   main_menu1()
  117.  
  118.  
  119. def add():   #addiction function    
  120.   print "Enter the numbers"
  121.   A=int(raw_input("Enter 1:"))# the first varialbe
  122.   B=int(raw_input("ENter 2:"))# second variable.
  123.   return A + B #mades is add
  124.  
  125. def subtract():            #subtraction function Ray
  126.   print "Enter the numbers"
  127.   A=int(raw_input("Enter 1:"))
  128.   B=int(raw_input("Enter 2:"))
  129.   return A - B
  130.  
  131. def Multiply(): #multiply ray
  132.   print "Enter the numbers"
  133.   A=int(raw_input("Enter 1:"))
  134.   B=int(raw_input("Enter 2:"))
  135.   return A * B
  136.  
  137. def divide():   #divide ray
  138.   print "Enter the numbers"
  139.   A=int(raw_input("Enter 1:"))
  140.   B=int(raw_input("Enter 2:"))
  141.   return A / B
  142.  
  143. def main_menu1(): #Main menu ray
  144.   print (50 * '-')
  145.   print '1. calculator'
  146.   print '2. train schedule'
  147.   print '3. system diagnostic'
  148.   print '4. reboot'
  149.   print '5. shutdown'
  150.   print '6. logoff'
  151.   print '7. roll dice'
  152.   main_menu = raw_input('what do you want to use')
  153.   if main_menu == '1':
  154.    calculator()
  155.   if main_menu == '2':
  156.    schedual(),
  157.    train()
  158.   elif main_menu == '3':
  159.    systemdi()
  160.   elif main_menu == '4':
  161.    reboot()
  162.   elif main_menu == '5':
  163.    shut_down()
  164.   elif main_menu == '6':
  165.    login()
  166.   elif main_menu == '7':
  167.    randomnumb()
  168.  
  169.  
  170. def shut_down(): #The function to shutdown the computer -Tyler
  171.   print 'shutting down'
  172.   time.sleep(1)
  173.   print '...'
  174.   time.sleep(1)
  175.   print '..'
  176.   time.sleep(1)
  177.   print '.'
  178.   exit()
  179.  
  180.  
  181.  
  182. def admin(): #
  183.   adminoveride = raw_input()
  184.   if adminoveride == 'overide123':
  185.    print 'Welcome %s' %user,
  186.    main_menu1()
  187.   else:
  188.    print 'password fail'  
  189.  
  190. def login():
  191.   print 'logged out'
  192.   time.sleep(1)
  193.   bye = '            ' """ ######::::#######:::#######::########:
  194.            ##... ##::##.... ##:##.... ##:##.... ##
  195.            ##:::..:::##:::: ##:##:::: ##:##:::: ##
  196.            ##::'####:##:::: ##:##:::: ##:##:::: ##
  197.            ##::: ##::##:::: ##:##:::: ##:##:::: ##
  198.            ##::: ##::##:::: ##:##:::: ##:##:::: ##
  199.             ######:::.#######::.#######::########:"""
  200.   bye2 ='            '"""########::'##:::'##:'########:
  201.            ##.... ##:. ##:'##:: ##.....::
  202.            ##:::: ##::. ####::: ##:::::::
  203.            ########::::. ##:::: ######:::
  204.            ##.... ##:::: ##:::: ##...::::
  205.            ##:::: ##:::: ##:::: ##:::::::
  206.            ########::::: ##:::: ########:"""
  207.  
  208.   print bye
  209.   print ' '
  210.   print bye2
  211.   rebootseq2()
  212.  
  213.  
  214. def passwordT(): #Tyler
  215.   print 'please type in password',
  216.   password = raw_input()
  217.   print (30 * '-')
  218.   if password == 'password1234':
  219.     print 'welcome %s'%user,
  220.     main_menu1()
  221.   elif password == "anything":
  222.     print 'work'
  223.   else:
  224.     print 'type admin override',
  225.     admin()
  226.  
  227. def passwordR(): #Ray
  228.   print 'please type in password',
  229.   password = raw_input()
  230.   print (30 * '-')
  231.   if password == 'password1234':
  232.     print 'welcome %s' %user, #The modules makes it so that the input would be the welcome
  233.     main_menu1()
  234.   elif password == "anything":
  235.     print 'work'
  236.   else:
  237.     print 'type admin override',
  238.     admin()
  239.  
  240. def reboot():# RAy
  241.   print 30*'-'
  242.   print 'Restarting computer please wait a few seconds'
  243.   time.sleep(1)
  244.   print '............'
  245.   time.sleep(1)
  246.   print '............'
  247.   time.sleep(1)
  248.   print '............'
  249.   time.sleep(1)
  250.   print '............'
  251.   rebootseq2()
  252.  
  253. def rebootseq2(): # This is to make the reboot start up again -Ray
  254.   print (30 * '-')
  255. print ("   L O G I N")
  256. print (30 * '-')
  257. print 'pick a user'
  258. print '\n admin Ray Jasinski \n Guest Tyler Kinney' #This is definitly made by ray
  259. print (30 *'-')
  260. user = raw_input()
  261. if user == 'tyler': #Made by tyler
  262.  passwordT()
  263. elif user == 'Tyler Kinney':
  264.  passwordT()
  265. elif user == 'Tyler':
  266.  passwordT()
  267. if user == 'ray': #made by ray
  268.  passwordR()
  269. elif user == 'Ray':
  270.  passwordR()
  271. elif user == 'Ray Jasinski':
  272.  passwordR()
  273. else:
  274.  print 'not a option'
  275.  
  276.  
  277.  
  278. print (30 * '-')# The start of the program.
  279. print ("   L O G I N")
  280. print (30 * '-')
  281. print 'pick a user'
  282. print '\n admin Ray Jasinski \n Guest Tyler Kinney' #This is definitly made by ray
  283. print (30 *'-')
  284. user = raw_input()
  285. if user == 'tyler': #Made by tyler
  286.  passwordT()
  287. elif user == 'Tyler Kinney':
  288.  passwordT()
  289. elif user == 'Tyler':
  290.  passwordT()
  291. elif user == 'Kinney':
  292.  passwordT()
  293. if user == 'ray': #made by ray
  294.  passwordR()
  295. elif user == 'Ray':
  296.  passwordR()
  297. elif user == 'Ray Jasinski':
  298.  passwordR()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement