标题: [特效代码] (已解决)批处理制作点餐菜单 [打印本页]
作者: panda951 时间: 2015-3-16 14:01 标题: (已解决)批处理制作点餐菜单
本帖最后由 panda951 于 2015-3-16 15:48 编辑
这个是我想出来的...
缺--选他里面其中一个要用什么符号/代码/数字弄到去加...
:food
:sup
:drink
只选一个就可以了- @echo off
-
- echo happy happy menu
- echo list
-
-
- :drink
- echo --------------------------------------
- set kopi=1
- set lemon tea=1
- set ice tea=2
- set tea=5
- set durian tea=7
- set grape tea=10
-
- echo drink
- echo kopi RM1
- echo lemon tea RM1
- echo ice tea RM2
- echo tea RM5
- echo durian tea RM7
- echo grape tea RM10
-
- echo pls choice your drink(1-6):
- set /p drink=
- echo --------------------------------------
- :food
- echo --------------------------------------
- set nasi=5
- set mee=9
- set nasi lemak=11
- set mee lemak=22
- set nasi lemak goreng=33
- set meel lemak goreng=100
-
- echo food
- echo nasi RM5
- echo mee RM9
- echo nasi lemak RM11
- echo mee lemak RM22
- echo nasi lemak goreng RM33
- echo meel lemak goreng RM100
-
- echo pls choice your food(1-6):
- set /p food=
- echo --------------------------------------
- :sup
- echo --------------------------------------
- set kamping=7
- set ikan=8
- set ayam=10
- set sotong=12
- set sea food=16
- set kamping vs ayam=18
-
- echo sup
- echo kamping RM7
- echo ikan RM8
- echo ayam Rm10
- echo sotong RM12
- echo sea food RM16
- echo kamping vs ayam RM18
-
- echo pls choice your sup(1-6):
- set /p sup=
- echo --------------------------------------
- echo --------------------------------------
- set service charge=5
- echo service charge RM 5
- echo --------------------------------------
-
- pls comfirm your order:
- echo food
- echo
-
- echo drink
- echo
-
- echo sup
- echo
- set /a total=%drink%+%food%+%sup%
- echo total RM%total%
-
- echo total you have to pay:
- set /a total1=%drink%+%food%+%sup%+%service charge%
-
- echo total have you to pay:
- echo RM%total1%
- pause
复制代码
作者: panda951 时间: 2015-3-16 14:03
有错麻烦纠正下...
作者: panda951 时间: 2015-3-16 14:07
例如
:food里面选1-6
1)xxx
2)zzz
3)ccc
4)vvv
5)bbb
6)nnn
作者: panda951 时间: 2015-3-16 14:09
附加 用什么方法都可以
作者: panda951 时间: 2015-3-16 14:31
- @echo off
-
- echo happy happy menu
- echo list
-
-
- :drink
- echo --------------------------------------
- set kopi=1
- set lemon tea=1
- set ice tea=2
- set tea=5
- set durian tea=7
- set grape tea=10
-
-
- echo drink
- echo kopi RM1
- echo lemon tea RM1
- echo ice tea RM2
- echo tea RM5
- echo durian tea RM7
- echo grape tea RM10
-
- echo pls choice your drink(1-6):
- set /p drink=
- echo --------------------------------------
- :food
- echo --------------------------------------
- set nasi=5
- set mee=9
- set nasi lemak=11
- set mee lemak=22
- set nasi lemak goreng=33
- set meel lemak goreng=100
-
-
- echo food
- echo nasi RM5
- echo mee RM9
- echo nasi lemak RM11
- echo mee lemak RM22
- echo nasi lemak goreng RM33
- echo meel lemak goreng RM100
-
- echo pls choice your food(1-6):
- set /p food=
- echo --------------------------------------
- :sup
- echo --------------------------------------
- set kamping=7
- set ikan=8
- set ayam=10
- set sotong=12
- set sea food=16
- set kamping vs ayam=18
-
-
- echo sup
- echo kamping RM7
- echo ikan RM8
- echo ayam Rm10
- echo sotong RM12
- echo sea food RM16
- echo kamping vs ayam RM18
-
- echo pls choice your sup(1-6):
- set /p sup=
- echo --------------------------------------
- echo --------------------------------------
- set service charge=5
- echo service charge RM 5
- echo --------------------------------------
-
- echo pls comfirm your order:
- echo food
- echo %food%
-
- echo drink
- echo %drink%
-
- echo sup
- echo %sup%
- set /a total=%drink%+%food%+%sup%
- echo total RM%total%
-
- echo total you have to pay:
- set /a total1=%drink%+%food%+%sup%+%service charge%
- echo RM%total1%
- pause
复制代码
发现一点点小错误(已修改)
还是不懂怎样set 两个在一起.....
如 set food=rm4 他也要是1号....
作者: pcl_test 时间: 2015-3-16 15:10
本帖最后由 pcl_test 于 2015-3-16 15:36 编辑
回复 2# panda951 - @echo off
- echo happy happy menu
- echo list
-
- echo --------------------------------------
- echo drink list :
- echo 1、kopi RM1
- echo 2、lemon tea RM1
- echo 3、ice tea RM2
- echo 4、tea RM5
- echo 5、durian tea RM7
- echo 6、grape tea RM10
-
- echo.
- :drink
- echo pls choice your drink(1-6):
- set /p drink=
- if not defined drink goto drink
- set dbill=0 & set d=null
- if %drink% == 1 set dbill=1 & set d=kopi
- if %drink% == 2 set dbill=1 & set d=lemon tea
- if %drink% == 3 set dbill=2 & set d=ice tea
- if %drink% == 4 set dbill=3 & set d=tea
- if %drink% == 5 set dbill=4 & set d=durian tea
- if %drink% == 6 set dbill=10 & set d=grape tea
- echo --------------------------------------
-
-
- echo --------------------------------------
- echo food list :
- echo 1、nasi RM5
- echo 2、mee RM9
- echo 3、nasi lemak RM11
- echo 4、mee lemak RM22
- echo 5、nasi lemak goreng RM33
- echo 6、meel lemak goreng RM100
-
- echo.
- :food
- echo pls choice your food(1-6):
- set /p food=
- if not defined food goto food
- set fbill=0 & set f=null
- if %food% == 1 set fbill=5 & set f=nasi
- if %food% == 2 set fbill=9 & set f=mee
- if %food% == 3 set fbill=11 & set f=nasi lemak
- if %food% == 4 set fbill=22 & set f=mee lemak
- if %food% == 5 set fbill=33 & set f=nasi lemak goreng
- if %food% == 6 set fbill=100 & set f=meel lemak goreng
- echo --------------------------------------
-
- echo --------------------------------------
- echo sup list :
- echo 1、kamping RM7
- echo 2、ikan RM8
- echo 3、ayam Rm10
- echo 4、sotong RM12
- echo 5、sea food RM16
- echo 6、kamping vs ayam RM18
-
- echo.
- :sup
- echo pls choice your sup(1-6):
- set /p sup=
- if not defined sup goto sup
- set sbill=0 & set s=null
- if %sup% == 1 set sbill=7 & set s=nasi
- if %sup% == 2 set sbill=8 & set s=mee
- if %sup% == 3 set sbill=10 & set s=nasi lemak
- if %sup% == 4 set sbill=12 & set s=mee lemak
- if %sup% == 5 set sbill=16 & set s=nasi lemak goreng
- if %sup% == 6 set sbill=18 & set s=meel lemak goreng
- echo --------------------------------------
-
- echo --------------------------------------
- echo pls comfirm your order:
- echo food: ^<%f%^>
- echo drink: ^<%d%^>
- echo sup: ^<%s%^>
- echo --------------------------------------
- set /a total=%dbill%+%fbill%+%sbill%
- echo total: RM%total%
- if %total% == 0 (set sc=0) else (set sc=5)
- echo service charge: RM%sc%
- echo --------------------------------------
- echo total you have to pay:
- set /a total1=%total%+%sc%
- echo RM%total1%
- pause
复制代码
作者: panda951 时间: 2015-3-16 15:42
回复 6# pcl_test
如果要在echo pls comfirm your order:
这边显示出
echo food: ^<%f%^>
echo drink: ^<%d%^>
echo sup: ^<%s%^>
的价钱大概要怎样做?
作者: panda951 时间: 2015-3-16 15:47
回复 6# pcl_test
不用了 已找到方法 感谢帮忙
作者: panda951 时间: 2015-3-16 15:50
回复 6# pcl_test
暂时无法给你评分 晚点补上
作者: pcl_test 时间: 2015-3-17 13:22
回复 8# panda951
你试试不用if ,只用goto、set、set /p、echo、pause,能不能做出跟我6楼代码同样的效果
作者: panda951 时间: 2015-3-18 14:32
回复 10# pcl_test
我用这个- @echo off
-
- echo happy happy menu
- echo list
-
- ::drink
- echo --------------------------------------
- echo drink list :
- echo 1、kopi RM1
- echo 2、lemon tea RM1
- echo 3、ice tea RM2
- echo 4、tea RM5
- echo 5、durian tea RM7
- echo 6、grape tea RM10
- echo.
- echo pls choice your drink(1-6):
- set /p drink=
- if %drink% == 1 set dbill=1 & set d=kopi
- if %drink% == 2 set dbill=1 & set d=lemon tea
- if %drink% == 3 set dbill=2 & set d=ice tea
- if %drink% == 4 set dbill=3 & set d=tea
- if %drink% == 5 set dbill=4 & set d=durian tea
- if %drink% == 6 set dbill=10 & set d=grape tea
- echo --------------------------------------
-
- ::food
- echo --------------------------------------
- set nasi=5
- set mee=9
- set nasi lemak=11
- set mee lemak=22
- set nasi lemak goreng=33
- set meel lemak goreng=100
-
-
- echo food list :
- echo 1、nasi RM5
- echo 2、mee RM9
- echo 3、nasi lemak RM11
- echo 4、mee lemak RM22
- echo 5、nasi lemak goreng RM33
- echo 6、meel lemak goreng RM100
-
- echo pls choice your food(1-6):
- set /p food=
- if %food% == 1 set fbill=5 & set f=nasi
- if %food% == 2 set fbill=9 & set f=mee
- if %food% == 3 set fbill=11 & set f=nasi lemak
- if %food% == 4 set fbill=22 & set f=mee lemak
- if %food% == 5 set fbill=33 & set f=nasi lemak goreng
- if %food% == 6 set fbill=100 & set f=meel lemak goreng
- echo --------------------------------------
- ::sup
- echo --------------------------------------
- set kamping=7
- set ikan=8
- set ayam=10
- set sotong=12
- set sea food=16
- set kamping vs ayam=18
-
-
- echo sup list :
- echo 1、kamping RM7
- echo 2、ikan RM8
- echo 3、ayam Rm10
- echo 4、sotong RM12
- echo 5、sea food RM16
- echo 6、kamping vs ayam RM18
-
- echo pls choice your sup(1-6):
- set /p sup=
- if %sup% == 1 set sbill=7 & set s=nasi
- if %sup% == 2 set sbill=8 & set s=mee
- if %sup% == 3 set sbill=10 & set s=nasi lemak
- if %sup% == 4 set sbill=12 & set s=mee lemak
- if %sup% == 5 set sbill=16 & set s=nasi lemak goreng
- if %sup% == 6 set sbill=18 & set s=meel lemak goreng
- echo --------------------------------------
-
- echo --------------------------------------
- echo pls comfirm your order:
- echo food: ^<%f%^> RM%fbill%
- echo drink: ^<%d%^> RM%dbill%
- echo sup: ^<%s%^> RM%sbill%
- echo --------------------------------------
- set /a total=%dbill%+%fbill%+%sbill%
- echo total: RM%total%
- set sc=5
- echo service charge: RM 5
- echo --------------------------------------
- echo total you have to pay:
- set /a total1=%total%+%sc%
- echo RM%total1%
- pause
复制代码
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |