Friday, January 28, 2022

Coffee Place Objects in Python

 A program that demonstrates how to declare an object in the Python programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg


Thank you very much for your support.







Program Listing

class Customers:
greeting = "\nWelcome to Coffee Palace!"

def __init__(self, c_1, c_2, c_3, c_4, c_5):
self.c_1 = c_1
self.c_2 = c_2
self.c_3 = c_3
self.c_4 = c_4
self.c_5 = c_5
arr = [self.c_1, self.c_2, self.c_3, self.c_4, self.c_5]

print("==============================================================================================================")

for customer in arr:
custName = customer.lower()
if (custName == "nate"):
print("Name=Nate\t Beverage=Espresso\t\t\t Food=Pastrami on rye\t\t Total=220")
elif (custName == "elaine"):
print("Name=Elaine\t Beverage=Strawberry frappuccino\t Food=Tuna Wrap\t\t Total=270")
elif (custName == "samirah"):
print("Name=Samirah\t Beverage=Iced caffe latte\t\t Food=Cinnamon roll\t\t Total=225")
elif (custName == "jerry"):
print("Name=Jerry\t Beverage=Caramel macchiato\t\t Food=Glazed doughnut\t\t Total=230")
elif (custName == "paz"):
print("Name=Paz\t Beverage=Iced tea\t\t\t Food=Blueberry pancakes\t Total=315")
else:
print("Customer name not found.")

print("==============================================================================================================")
print()

print(Customers.greeting)
Customers("Nate", "Elaine", "Samirah", "Jerry", "Paz")

No comments:

Post a Comment