# Moudule I used are Module 7 U1M1A1.17, and Module 7.2 U1M1A1.7.2
#Candy bar order
#Made by: Braeden Culp date 12/12/2022
#Questions
"""
summary line – what is the function doing.
args: It letting the user type what candy bar they would like to order and it gives them a price.
descriptions of parameters
returns: it is outputing the total amount
descriptions of return values: the user has to select the number of what candy choose they want to get to S,M,L and then total
"""
# Describe something that surprised you as you worked on your project.
# what surprised me was on how much code I had to put in on this project
# Describe any challenges you had this week.
# the def function was challenging
# Did anyone help you this week? Who and how?
# my teacher was realy helpful he helped me read on how my code worked
# Choose an adjective that describes how you are feeling about your project. Explain why you chose this word.
# I feel bright about my code because my code works and functions properly
# If you had more time to work on this project, what would you add?
# I would add error handling and search
#You can choose from S,M,L candy bar
#password protect
# Candy Choices
#Avable sizes
import random
#candy order
def pass_protect():
username = 'Candyman876'
password = 'Mancandy098'
approved=False
authorized=False
userInput = input("What is your username?\n")
while approved ==False:
if userInput == username:
approved=True
a=input("Password?\n")
while authorized==False:
if a == password:
authorized=True
print("Welcome!\n")
print("The program will now initialize...\n")
else:
print("That is the wrong password.")
a=input("Password?\n")
else:
print("That is the wrong username.")
userInput = input("What is your username?\n")
#pass_protect()
def candy_order():
# Candy Choices
num_1="1 - Reese's Peanut Butter Cups"
num_2="2 - Skittles"
num_3="3 - Snickers"
num_4="4 - M&M's"
num_5="5 - Almond Joy"
num_6="6 - Kit Kat"
num_7="7 - Butterfinger"
num_8="8 - Baby Ruth"
candy_list=[num_1,num_2,num_3,num_4,num_5,num_6,num_7,num_8]
print("Choose from the selections below:","Enter the number:",random.sample(candy_list, 4))
candy_choice=input("What kind of candy would you like?")
print("Welcome to amazon what candy bar size do you want")
print("Please insert what candy bar size you want")
#Avable sizes
S=0
M=0
L=0
candy_order=""
# Candy Prices
s_price=1.50
m_price=2.50
l_price=3.50
while True:
total = S*s_price + M*m_price + L*l_price
# How many candy's you want
candy_order=input("What size candy bar would you like to order?\nEnter exit to quit \nEnter S, M, L:")
if candy_order.upper()=="S":
s_qty=int(input("How many small candys would you like?"))
S=s_qty
elif candy_order.upper()=="M":
m_qty=int(input("How many medium candys would you like?"))
M=m_qty
elif candy_order.upper()=="L":
l_qty=int(input("How many large candys would you like?"))
L=l_qty
elif candy_order=="exit":
print("You ordered",S,"small,",M,"medium,","and",L,"large.")
print("Your total is $",total)
print("Your order has been confermed thank you for using amazon")
break
else:
print("That is not an available size.")
print("Thank you for shoping at amazon")
break
candy_order()