Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # A Code By Mike Desousa
- #Imports were used because both math and strings are needed in order to complete the code and global variable for the whole code.
- import math
- import string
- global cars
- global cars1
- cars = [("WRX", "FocusRS")]
- cars1 = 2
- #Here I defined listc for when the My Vehicles option is called
- def listc():
- cars
- cars1
- print "Hello, How can I help you?"
- print "1. My Vehicles"
- print "2. Alphabetical Order"
- choice = raw_input(">")
- choice = int(choice)
- if choice == 1 :
- while cars1 < 3 :
- print "Would you like to add a vehicle?"
- print "1. I would like to add a vehicle."
- print "2. I would not like to add a vehicle"
- choice1 = raw_input(">")
- choice1 = int(choice1)
- if choice1 == 1 :
- addcars()
- elif choice1 == 2 :
- print "Ok"
- listc()
- else:
- print "Invalid answer"
- listc()
- print cars1
- SCAT()
- elif choice == 2 :
- alphabetize = raw_input("Would you like to put them in alphabetical order?")
- if alphabetize == "yes":
- print "FocusRS /n WRX"
- SCAT()
- elif alphabetize == "no":
- print "Ok"
- SCAT()
- else:
- print "Invalid answer"
- listc()
- else:
- print "Invalid Answer"
- listc()
- #This is the Main Menu Function you will be encounter when you first go into the code
- def SCAT():
- print "Welcome to the Self-Kept Car Assembly Technology also known as SCAT"
- print "___________________________________"
- name = raw_input("Type in your username:")
- password = raw_input("Type in your password:")
- print "Hello %s,What are your wishes?" % name
- print "1. My Vehicles"
- print "2. Add Vehicles"
- print "3. Delete Vehicles"
- print "4.Edit Vehicles"
- print "5. Exit Program"
- option = raw_input(">")
- option = int(option)
- if option == 1:
- listc()
- elif option == 2:
- addcars()
- elif option == 3:
- delete()
- elif option == 4:
- edit()
- elif option == 5:
- exit
- else:
- print "Invalid answer"
- SCAT()
- # Here I added a function to give the option to add cars to the List of availavle vehicles
- def addcars():
- cars
- cars1
- print "This is the car menu"
- print "What would you like to do?"
- print "1. Add Vehicles"
- print "2. Return to main menu"
- acar = raw_input(">")
- acar = int(acar)
- if acar == 1 :
- while cars1 < 3 :
- print "Would you like to add a vehicle?"
- print "1. I would like to add a vehicle."
- print "2. I would not like to add a vehicle"
- choice1 = raw_input(">")
- choice1 = int(choice1)
- if choice1 == 1 :
- ncar = raw_input("What type of vehicle do you want to add?")
- print "You want to add a/an %s? Are you sure?" % ncar
- print "1. Yes"
- print "2. No"
- ncar1 = raw_input(">")
- ncar1 = int(ncar1)
- if ncar1 == 1:
- print "WRX, FocusRS, %s" % ncar
- print "What would you like to do next?"
- print "1. Edit"
- print "2. Delete"
- print "3. Exit Program"
- choicer = raw_input(">")
- choicer = int(choicer)
- if choicer == 1 :
- color = raw_input("What color do you want it to be?")
- print "So you want your %s to be %s" % (ncar, color)
- print "Ok bringing you back to the main menu"
- SCAT()
- elif choicer == 2 :
- delete()
- elif choicer == 3 :
- print "Leaving program."
- break
- elif choice1 == 2 :
- print "Ok"
- addcars()
- else:
- print "Invalid answer"
- addcars()
- print cars
- elif acar == 2 :
- SCAT()
- else:
- print "Invalid answer"
- addcars()
- # Now I added a option to delete cars from the list in order to add new ones.
- def delete():
- cars
- cars1
- while cars1 < 3:
- print "Are you sure you want to delete?\n1.Yes\n2.No"
- choice = raw_input(">")
- choice = int(choice)
- if choice == 1 :
- choice2 == raw_input("What vehicle do you want to delete?")
- if choice == "WRX":
- print "FocusRS"
- if choice == "FocusRS":
- print "WRX"
- if choice == 2:
- print "Bringing you back to the main menu"
- SCAT()
- # lastly we have our edit function which lets you change car colors.
- def edit():
- cars
- cars1
- while cars1 < 3: # While loop that states if you should delete car or not
- print "Are you sure you want to edit?\n1.Yes\n2.No"
- choice = raw_input(">")
- if choice == 1:
- ccar = raw_input("What Vehicle do you want to customize?")
- ccar1 = raw_input("What color do you want to make %s ?") % ccar
- print "So you want to make your %s a shade of %s, sounds good to me." % (ccar, ccar1)
- SCAT()
- elif choice == 2:
- print "Returning to main menu"
- SCAT()
- #The main Menu
- print "Welcome to the Self-Kept Car Assembly Technology also known as SCAT"
- print "____________________________________"
- name = raw_input("Type in your username:")
- password = raw_input("Type in your password:")
- print "Hello %s,What are your wishes?" % name
- print "1. My Vehicles"
- print "2. Add Vehicles"
- print "3. Delete Vehicles"
- print "4. Edit Vehicles"
- print "5. Exit Program"
- option = raw_input(">")
- option = int(option)
- if option == 1 :
- listc()
- elif option == 2:
- addcars()
- elif option == 3 :
- delete()
- elif option == 4 :
- edit()
- elif option == 5 :
- exit
- else:
- print "Invalid Answer"
- SCAT()
Add Comment
Please, Sign In to add comment