Menú

Reciept Project

Reciept Project - student project

Followed along on Replit, including checking and trying the code myself.

 

# Project: Create a Receipt

#Printing Program

# Step 0-Set up a flow
#chart/outline of the program

# Step 1-Set foundation/
#variables

# Below is a way to declare multiple variables in the same line

p1_name, p1_price = "Oranges", 5.90
p2_name, p2_price = "Shampoo", 3.70
p3_name, p3_price = "Olive Oil", 9.50

# Create a Company name and
#information

company_name = "golden corner"
company_address = "2 Mandilara St."
company_city = "Rodos, Gr"

# Declare ending message

message = "Thanks for shopping with us today!"

# create a top border

print("*" * 50)

# print company information first, using format

print("\t\t{}".format(company_name.title()))
print("\t\t{}".format(company_address))
print("\t\t{}".format(company_city))

# print a line between sections

print("=" * 50)

# print out header for section of items purchased

print("\tProduct Name\tProduct Price")

# create a print statement for each product

print("\t{}\t\t${}".format(p1_name.title(), p1_price))
print("\t{}\t\t${}".format(p2_name.title(), p2_price))
print("\t{}\t${}".format(p3_name.title(), p3_price))

# print a line between sections

print("=" * 50)

# print out header for section of total

print("\t\t\tTotal")

# calculate total price and print out

total = p1_price + p2_price + p3_price
print("\t\t\t${}".format(total))

# print a line between sections

print("=" * 50)

# output thank you message

print("\n\t{}\n".format(message))

# create a bottom border

print("*" * 50)