In this lab, you complete a partially prewritten Python program that includes a function with no parameters. The program

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

In this lab, you complete a partially prewritten Python program that includes a function with no parameters. The program

Post by answerhappygod »

In this lab, you
complete a partially prewritten Python program that includes a
function with no parameters.
The program asks the
user if they have preregistered for art show tickets. If the user
has preregistered, the program should call a function
named discount() that displays the
message "You are preregistered and qualify for a 5%
discount." If the user has not preregistered, the
program should call a function named noDiscount() that
displays the message "Sorry, you did not preregister
and do not qualify for a 5% discount."
The source code file
provided for this lab includes the
necessary input statement. Comments are included in the
file to help you write the remainder of the program.
Instructions
In This Lab You Complete A Partially Prewritten Python Program That Includes A Function With No Parameters The Program 1
In This Lab You Complete A Partially Prewritten Python Program That Includes A Function With No Parameters The Program 1 (70.64 KiB) Viewed 103 times
Tasks ArtShow.py > Terminal 1 lil Did you proregister? Enter Y or N: Y You are preregistered and qualify for a 5% dis </> Results You are pre registered and qualify for . 5discount. Show Details 2 3 # Write discount function here. 4 def discount(): 5 print("You are preregistered and qualify for a 5% discount.") G 7 # Write noDiscount function here. 8 def noDiscount(): 9 print("Sorry, you did not preregister and do not qualify for a 5% discount.") 1@ 11 if __name__ == '__main__': 12 registerString = input("Did you preregister? Enter Y Or N: ") 13 # Test input here. If y, call discount(), else call noDiscount(). 14 if(registerString=="Y"); 15 discount) 16 else: 17 noDiscount) 18 Not pre-registered input produces correct output GOD auto 10.00 O out of 1 checks passed. Review the results below for more details. Checks Test Case Incompleta Not pre-registered test Input N Output Did you preregister? Enter Y or N: N Sorry, you did not preregister and do not qual Results 5% discount. Show Details Run checks Submit 50%

ITI Tasks ArtShow.py > Terminal 1 Pre-registered input produces correct output QUOD out of 10.00 O out of 1 checks passed. Review the results below for more details. Checks 2 3 # Write discount function here. 4 def discount(): 5 print("You are preregistered and qualify for a 5% discount.") 6 7 # Write noDiscount function here. 8 def noDiscount(): 9 print("Sorry, you did not preregister and do not qualify for a 5% discount.") 1@ 11 if .-namo... == 'main': 12 registerString = input("Did you preregister? Enter Y Or N: ") 13 # Test input here. If y, call discount(), else call noDiscount(). 14 if(registerString=="Y"): 15 discount) 16 else: 17 noDiscount) 18 Test Case Incomalate Pre-registered test Input Y 1 Output Did you preregister? Enter Y or N: Y You are preregistered and qualify for a 5% dis Results You are pre-registered and qualify for a 5% discount. Show Details Not pre-registered input produces correct output ago out of 1000 102 O out of 1 checks passed. Review the results below for more details Checks Test Case Incomplete Run checks Submit 50%
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply