print("\n" * 5)
import datetime
import os
list_foods = []
list_drinks = []
list_services = []
list_item_price = [0] * 100
var_discount_1 = 200
var_discount_2 = 1000
var_discount_3 = 5000
var_discount_1_rate = 0.05
var_discount_2_rate = 0.10
var_discount_3_rate = 0.15
navigator_symbol = "/"
if os.name == "nt":
navigator_symbol = "\\"
def def_default():
global list_drinks, list_foods, list_services, list_item_order, list_item_price
list_item_order = [0] * 100
def_default()
def def_main():
while True:
print("*" * 28 + "FOOD ORDERING SYSTEM" + "*" * 24 + "\n")
print("*" * 31 + "MAIN MENU" + "*" * 32 + "\n"
"\t(O) ORDER\n"
"\t(R) REPORT\n"
"\t(P) PAYMENT\n"
"\t(E) EXIT\n" +
"_" * 72)
input_1 = str(input("Please Select Your Operation: ")).upper()
if (len(input_1) == 1):
if (input_1 == 'O'):
print("\n" * 10)
def_order_menu()
break
elif (input_1 == 'R'):
print("\n" * 10)
def_report()
break
elif (input_1 == 'P'):
print("\n" * 10)
def_payment()
break
elif (input_1 == 'E'):
print("*" * 32 + "THANK YOU" + "*" * 31 + "\n")
break
else:
print("\n" * 10 + "ERROR: Invalid Input (" + str(input_1) + "). Try again!")
else:
print("\n" * 10 + "ERROR: Invalid Input (" + str(input_1) + "). Try again!")
def def_order_menu():
while True:
print("*" * 31 + "ORDER PAGE" + "*" * 31 + "\n"
"\t(F) FOODS AND DRINKS\n"
"\t(O) OTHER SERVICES\n"
"\t(M) MAIN MENU\n"
"\t(E) EXIT\n" +
"_" * 72)
input_1 = str(input("Please Select Your Operation: ")).upper()
if len(input_1) == 1:
if (input_1 == 'F'):
print("\n" * 10)
def_food_drink_order()
break
elif (input_1 == 'O'):
print("\n" * 10)
def_other_services()
break
elif (input_1 == 'M'):
print("\n" * 10)
def_main()
break
elif (input_1 == 'E'):
print("*" * 32 + "THANK YOU" + "*" * 31 + "\n")
break
else:
print("\n" * 10 + "ERROR: Invalid Input (" + str(input_1) + "). Try again!")
else:
print("\n" * 10 + "ERROR: Invalid Input (" + str(input_1) + "). Try again!")
def def_full_file_reader():
file_foods = open('files'+navigator_symbol+'list_foods.fsd', 'r')
for i in file_foods:
list_foods.append(str(i.strip()))
file_foods.close()
file_drinks = open('files'+navigator_symbol+'list_drinks.fsd', 'r')
for i in file_drinks:
list_drinks.append(str(i.strip()))
file_drinks.close()
file_services = open('files'+navigator_symbol+'list_services.fsd', 'r')
for i in file_services:
list_services.append(str(i.strip()))
file_services.close()
i = 0
while i <= (len(list_foods) - 1):
if '$' in list_foods[i]:
list_foods[i] = str(list_foods[i][:list_foods[i].index('$') - 1]) + ' ' * (20 - (list_foods[i].index('$') - 1)) + str(list_foods[i][list_foods[i].index('$'):])
i += 1
i = 0
while i <= (len(list_drinks) - 1):
if '$' in list_drinks[i]:
list_drinks[i] = str(list_drinks[i][:list_drinks[i].index('$') - 1]) + ' ' * (20 - (list_drinks[i].index('$') - 1)) + str(list_drinks[i][list_drinks[i].index('$'):])
i += 1
i = 0
while i <= (len(list_services) - 1):
if '$' in list_services[i]:
list_services[i] = str(list_services[i][:list_services[i].index('$') - 1]) + ' ' * (20 - (list_services[i].index('$') - 1)) + str(list_services[i][list_services[i].index('$'):])
i += 1
def_full_file_reader()
def def_file_sorter():
global list_foods, list_drinks, list_services
list_foods = sorted(list_foods)
list_drinks = sorted(list_drinks)
list_services = sorted(list_services)
i = 0
while i < len(list_foods):
list_item_price[i] = float(list_foods[i][int(list_foods[i].index("$") + 2):])
i += 1
i = 0
while i < len(list_drinks):
list_item_price[40 + i] = float(list_drinks[i][int(list_drinks[i].index("$") + 2):])
i += 1
i = 0
while i < len(list_services):
list_item_price[80 + i] = float(list_services[i][int(list_services[i].index("$") + 2):])
i += 1
def_file_sorter()
def def_food_drink_order():
while True:
print("*" * 26 + "ORDER FOODS & DRINKS" + "*" * 26)
print(" |NO| |FOOD NAME| |PRICE| | |NO| |DRINK NAME| |PRICE|")
i = 0
while i < len(list_foods) or i < len(list_drinks):
var_space = 1
if i <= 8:
var_space = 2
if i < len(list_foods):
food = " (" + str(i + 1) + ")" + " " * var_space + str(list_foods[i]) + " | "
else:
food = " " * 36 + "| "
if i < len(list_drinks):
drink = "(" + str(41 + i) + ")" + " " + str(list_drinks[i])
else:
drink = ""
print(food, drink)
i += 1
print("\n (M) MAIN MENU (P) PAYMENT (E) EXIT\n" + "_" * 72)
input_1 = input("Please Select Your Operation: ").upper()
if (input_1 == 'M'):
print("\n" * 10)
def_main()
break
if (input_1 == 'E'):
print("*" * 32 + "THANK YOU" + "*" * 31 + "\n")
break
if (input_1 == 'P'):
print("\n" * 10)
def_payment()
break
try:
int(input_1)
if ((int(input_1) <= len(list_foods) and int(input_1) > 0) or (int(input_1) <= len(list_drinks) + 40 and int(input_1) > 40)):
try:
print("\n" + "_" * 72 + "\n" + str(list_foods[int(input_1) - 1]))
except:
pass
try:
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![chm](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 5 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/050594e444c64b2ca6bfa9c9233b34a1_weixin_39130678.jpg!1)
0and1调研
- 粉丝: 16
- 资源: 1203
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- 1719856762160904_download.jsp
- Screenshot_2024-07-02-01-58-45-367_net.csdn.csdnplus-edit.jpg
- html+js+csse-prediction-ma笔记
- a*搜索求解8数码问题e-series-maste笔记
- multisim仿真电路图ce-prediction-mast开发笔记
- 企业网络规划与设计l-time-series-maste笔记
- 俄罗斯方块c语言prediction-m笔记
- a*搜索求解8数码问题l-time-serie开发笔记
- 企业网络规划与设计-prediction-maste笔记
- html+js+csse-series-m开发笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)