#Name: Mandy Brown
#Program purpose: To calculate theatre ticket price basing on the patron's age and 3D
#Completion Date: 11/6/2020
#Course:CMIS 102

print('Welcome to Price Calculator')
user_age=int(input('Enter the Your Age: '))
user_answer=input('Is the program 3D? yes/no: ')
children_cutoff_age=15 #age cutoff for childrem
seniors_cutoff_age=60 # age cutoff for seniors
children_discount=30 #discount for kids below 15
senior_discount=10 #discounts for seniors above 60
movie_price=100 #normal movie charge
extra_charge = 50 #if 3D

def checkIfMovieis3D(userinput):# this methods checks the user inputs and determines if the movies is 3D or not.
     if(userinput.upper()=="YES"):#Chnaging user input to uppercase and making comparison
         print("Is 3D - Extra charge.......................",extra_charge)
         return extra_charge #in case the movie is 3D an extra charge will be returned
     elif(userinput.upper()=="NO"):
         print("Not 3D - Extra charge.......................",0)
         return 0 # no extra charge will required if movies is not 3D

if(user_age>children_cutoff_age and user_age<seniors_cutoff_age):# if the users age is above the children's cut_off but less than the seniors cut_off - the person is in another group
    print("\n-------------------------------------------")
    print("You do not qualify for discount")
    total = movie_price+checkIfMovieis3D(user_answer) # since this group is not eligible for discount, extra charge is added to movie price directly.
    print("Price..................................... 100")
    print("Discount....................................0")
    print("Your total is .............................",total)
    print("---------------------------------------------")
elif(user_age<=children_cutoff_age): # all individuals below 15 are categorised as children
    print("\n-------------------------------------------")
    print("Hello kid, you qualify for a discount")
    total= (movie_price-children_discount)+checkIfMovieis3D(user_answer) #the normal price - discount plus the extra charge for 3D
    print("Price.................................... 100")
    print("Discount................................. ",children_discount)
    print("Your total is ..........................",total)
    print("---------------------------------------------")
elif(user_age>=seniors_cutoff_age): #all individuals above 60 are seniors
    print("\n-------------------------------------------")
    print("Hello Senior, you qualify for a discount")
    total= (movie_price-senior_discount)+checkIfMovieis3D(user_answer) #the normal price - discount plus the extra charge for 3D
    print("Price.................................... 100")
    print("Discount................................. ",senior_discount)
    print("Your total is ..........................",total)
    print("---------------------------------------------")
