Answer:
The program is written in Python.
- def discount():
- print("You are preregistered and qualify for a 5% discount.")
-
- def noDiscount():
- print("Sorry, you did not preregister and do not qualify for a 5% discount.")
-
-
- print("Have your preregistered for art show tickets:")
- user_input = input("Y (Yes) or N (No): ")
-
- if(user_input == 'Y'):
- discount()
- else:
- noDiscount()
Step-by-step explanation:
We start with defining two simple functions, discount() (Line 1-2) and noDiscount() (Line 4-5). The two function are just to print a simple message as required by the question.
Next, in the main program (Line 8 - 14), prompt the user for the input either Y (Yes) or N (No) to check if they have pre-registered the art show tickets (Line 8 -9).
If user_input is "Y", call the discount() function else, call noDiscount() function (Line 11- 14). The message defined in each function will be printed accordingly.