0% found this document useful (0 votes)
62 views5 pages

Python Discount Program Project

The document provides instructions for a programming assignment to create a Python program that tests Boolean conditions based on user input. Students are given three options to choose from for the basis of their program - creating a membership criteria for a club, designing a discount program, or creating their own program that tests at least three conditions. The assignment then outlines the steps to plan and design the program, including writing pseudocode, coding it in Python, testing it, and considering future improvements or expansions.

Uploaded by

Bob Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views5 pages

Python Discount Program Project

The document provides instructions for a programming assignment to create a Python program that tests Boolean conditions based on user input. Students are given three options to choose from for the basis of their program - creating a membership criteria for a club, designing a discount program, or creating their own program that tests at least three conditions. The assignment then outlines the steps to plan and design the program, including writing pseudocode, coding it in Python, testing it, and considering future improvements or expansions.

Uploaded by

Bob Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd

04.

06 Module Four Project

Name: Daniel Romanov

Directions

If you are up for a programming challenge, read on. If not, take a deep breath and then read on. You will
use the software development life cycle (SDLC) to create a working program of your choice that will test
Boolean conditions based on user input. Your program can include any Python skills and functions you
have learned up to this point.

This assignment has five parts.

Step One: Planning & Analysis


Read the options carefully and choose ONE as the basis of your project.

Option 1 – Members Only

If you were going to create a club, what would it be and how could people join? Think about the
membership requirements. Would members have to be between certain ages? Would they have to like
certain things? Would they need certain skills? Because you are president of the club, you get to decide
the criteria! (Just make sure the conditions are school appropriate.)

Follow these steps to begin your planning:

1. Create a club name and explain your club's purpose.


2. List the conditions (at least 3) to be a member of your club. Remember you have learned about
if, if-else, elif, and logical operators (and, or, not), so you can test for just about
anything.

Option 2 – Discount Deals

Saving money makes people smile! So, your job is to spread the cheer by coming up with a discount plan.
For example, maybe people who are under 18 with green eyes get $5 off the admission price. Maybe you
want to reward honor roll students, military personnel, or state residents with free parking. Since this is
your discount plan, you get to decide the criteria. (Just make sure the conditions are school appropriate.)

Follow these steps to begin your planning:

1. Choose a place (amusement park, movie theatre, sporting event, online store, etc.) and explain
your discount program.
2. List the conditions (at least 3) to qualify for a discount. Remember you have learned about if,
if-else, elif, and logical operators (and, or, not), so you can test for just about anything.
Option 3 – Programmer’s Adventure

If you want to journey the road less traveled and create your own program option, go for it! Keep in
mind, the goal of your program is to evaluate at least three conditions based on user input. Remember
you have learned about if, if-else, elif, and logical operators (and, or, not), so you can test for
just about anything.

Possible Program Options:

 Eye on the Prize – Create a contest and the conditions to win.


 Let Them Eat Cake! – Order a cake based on certain conditions.
 Dream Destination – Suggest a vacation destination based on certain conditions.

Step Two: Design


It’s time to design your program by writing pseudocode. Be sure detail the input, calculations, decisions,
and output. Your program must include the following elements:

 Input statements
 Three input statements requesting data (numeric or non-numeric) from the user
 Use of the int() and float() functions, if needed
 Decision statements
 One if, if-else, or elif statement
 One logical operator (and, or, not) in a Boolean condition
 Output statements
 Create clear and well organized output to display messages that show the user’s input
and the results of the decision statements.
 Show proper use of the str() function, if needed.
 Optional
 Use a list to store values.

Insert your pseudocode here:

Def main():
Input(user name)
Input(age)
Input(group size)
Input(active persons)
Elif (all discount options)
Print(results)

Step Three: Coding


Use the following guidelines to write your program:

1. To code the program, use the Python IDLE.


2. Using comments, type a heading that includes your name, today’s date, and a short description
of the program.
3. Follow the Python style conventions regarding indentation and the use of white space in your
program.
4. Use meaningful names for all variables.

Example of expected output: The output for your program should resemble the following screen shot.
Your specific results will vary depending on the choices you make and the input provided.

Insert a copy of your code from the IDLE here:

def main():

name = input("Hello, what's your name?")

print("Welcome to the UEFA Champion's League final, " + name + ".")

print("Regular tickets are $84.69.")

age = int(input("How old are you?"))

groupSize = int(input("How many people are in your group?"))


activePersons = input("Are you a student, military veteran, active service member, or a medical worker?
y/n")

print("")

print("Age: " + str(age))

print("Group size: " + str(groupSize))

print("Student, Military Veteran, Active Service Member, Medical Worker? " + activePersons)

print("")

if groupSize >= 10:

print("Your whole group qualifies for a discounted price of $63.52 per person.")

elif age <= 16:

print("You qualify for a discounted price of $71.99.")

elif age >= 60 or activePersons == "y":

print("You qualify for a discounted price of $50.81.")

else:

print("Sorry, you do not qualify for a discount.")

main()

Step Four: Testing


Run your code and evaluate the output. Then, answer the following questions in the testing chart. Use
two to three meaningful sentences to answer each question.

Testing Question Response


I did not indent properly, and the variable names
What bugs did you identify in your code? were mistyped

I fixed all of the indentations and I fixed the


How did you fix the bugs? variable names
Step Five: Maintenance
Passionate programmers strive to improve their code! In two to three meaningful sentences, answer the
following questions in the maintenance chart to consider the next steps of your program.

Maintenance Question Response


You could make more options for discounts in the
What design and functionality improvements could code based on new parameters
you make to your program?

You could distribute copies of the code online or to


How can you get feedback on ways to improve friends and family
your program?

You could add more events to purchase tickets for,


How can you expand your program into a new, and with the new events add new discount offers
better program in the future?

The event that they are searching for may not be in


What are potential bugs users may possibly the code, so they wouldn’t be able to get any final
encounter if your program is expanded into a new results.
program in the future?

You might also like