ulvis.paste.net

Paste Search Dynamic
Recent pastes
Car Park Code
  1. ticketprice = 8
  2. engineerpassword = "12345"
  3. spaces = 60
  4.  
  5. while true:
  6.    
  7.     print("Jack's Car Park now has ", spaces, " spaces.\n")
  8.    
  9.     reg=input("Please enter last three characters of your car reg: ")
  10.     if reg==engineerpassword:
  11.         ticketprice=int(input("Hello engineer! Please enter a new ticketprice: "))
  12.         reg="***"
  13.         spaces = spaces+1        
  14.    
  15.     print("Please insert £", ticketprice, "for a ticket")
  16.  
  17.     totalcash=0
  18.    
  19.     while totalcash< ticketprice:
  20.         coins=int(input("Enter Pound coins "))
  21.         totalcash=totalcash+coins
  22.         print ("\nSo far you have instered £", totalcash)
  23.         print()
  24.         print()
  25.  
  26.     print ("Thank you")
  27.  
  28.     if totalcash >ticketprice:
  29.         print ("Thank you, please collect your change of £", (totalcash - ticketprice))
  30.    
  31.  
  32.  
  33.     if ticketprice<10:
  34.         padding="   *"
  35.     else:
  36.         padding="  *"
  37.    
  38.     print ("Printing yout ticket. . .")
  39.     print()
  40.     print()
  41.     print()
  42.     print("**************************")
  43.     print("*     Parking Ticket     *")
  44.     print("*                        *")
  45.     print("*                        *")
  46.     print("*     Fee Paid of £",ticketprice, padding )
  47.     print("*                        *")
  48.     print("*     Car Reg:",reg, "      *")
  49.     print("**************************")
  50.     print()
  51.     print()
  52.     print()
  53.  
  54.     spaces = spaces-1
  55.  
  56.     file=open("DataLog","a")
  57.     outputdata=reg+","+str(ticketprice)+"\n"
  58.     file.write(outputdata)
  59.     file.close()
Parsed in 0.019 seconds