Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Functions with No Parameters Summary In this lab, you complete a partially prewritten Python program that includes a function with no parameters. The program asks

Functions with No Parameters

Summary

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

Make sure the file ArtShow.py is selected and open.

Write the Python statements as indicated by the comments.

Execute the program by clicking the "Run Code" button at the bottom of the screen.

""" ArtShow.py - This program determines if an art show attendee gets a 5% discount for preregistering. Input: Interactive. Output: A statement telling the user if they get a discount or no discount. """

# Write discount function here.

# Write noDiscount function here.

if __name__ == '__main__': registerString = input("Did you preregister? Enter Y or N: ")

# Test input here. If Y, call discount(), else call noDiscount().

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

Students also viewed these Databases questions

Question

What type of situation (win/lose) is the goal of negotiation?

Answered: 1 week ago

Question

What are the attributes of a technical decision?

Answered: 1 week ago

Question

How do the two components of this theory work together?

Answered: 1 week ago