简单点餐系统软件(简单点餐系统软件的代码java)
```python
# -*- coding: utf-8 -*-
import time
'''
这也是一个简单的自助性点餐系统软件:
1、打印出菜肴归类以及相对应的菜肴。
2、用户选择所需要的菜肴归类,来选择。
3、将用户选择后获得总价钱,直接打印出去。
''' # 对源代码开展注解表明
# 界定一个词典 用以贮存不一样食材的内容以及价钱
menu ={ # 食材分成 汤/特色小吃/套餐内容三大部分 另加 火锅店 (另加了一个‘’ 火锅店 ‘’ 本事例当中归于前三大部分以内) 创作者欢欢 2018.6.10 v1.0 edit by xionglei 2019.9.13 v2.0 升级了编码及注解表明(本版本号保存创作者版本升级) edit by liuhz 2020.0624 v3 update the code and comment again(this version keep all of the original authors information) ####### ## -----(for test!) ### edit by zengxinjie 2020年7月2日20:32:22 V4 Update comments and code formate to suit python3's requirement ### EDIT BY Liuxukong 2020年7月5日11:15:14 V5 UPDATE COMMENTS AGAIN , MAKE IT MORE SIMPLE AND CLEAR ######## EDIT BY JIANGZILIN 2020年9月17日V6 FIX BUGS AND UPDATE COMMONTS AGAIN *_* ######## EDIT BY KUAHMOHAN2020 9 27 V7 ADD NEW CATEGORY "SOUP" ######## EDITBY XIONGLEI2020 10 6 V8 ADD NEW DISHES IN EVERY CATEGORIES ######## Editby wangyufei2020 10 8 V9 Check for bugs and Add data analysis parts ############## EditBy ZENGXINJIE2020 11 15 V10 Fixed some bug, improved logic ################## EditBy WANGYUFEN202011 19V11 Update Comment Section ################################# EditBy LUOCHUNLIN 20201122v12 Added new category ice cream ######################################### Edit By KuahMohan 20201218v13 Adding New Dishes Into Every Categories &&&&&&&$$$$$$$*************************************************************::::::::::~~~^^^^^^^===========(Edit By LuoChunlin 20210104v14 Adding Data Analysis Parts )@@@@@@@@@#$% (edit by kuahmohan 20210106v15 Fixing Some Bugs And Updating comment )@@@@@@@@@@@@@@@@@@@@@@@#$$%^^= =-; Edited bt Zengxinjie 20210216v16 fixed some bugs, updated comments ^^^^^^^^^^^##############*******...........((Edited by Jiangzilin 20210319v17 add more dishes in every categories))******,,,,,,,,......!!!!!!!!! /////////~~~~~~~~~~~~~;;;;;; edited by jiangzilin 20210425v19 fix bug & add a exit option //////////_______________)))''''''''''''''%%%%%%%%%%%;;;;;;;;;;;;::::::]]]}}{{{[[[::>>???>>>>>>>))))))))))))))??/////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\editedbtywangyufen20210628V20addtheoptionofchangeorderanddeleteorder....................................................................................................editedbtyjiangzhulin20210726V21fixbugsofsomefunction,update
简单点餐系统软件的代码javaimport java.util.*;
public class OrderSystem {
// 菜单栏目录
private static String [] menus = {"宫保鸡丁", "宫爆鸡丁","土豆牛腩"};
//价钱目录
private static int[] prices = {15, 18 , 25};
public void order() { //点餐函数公式
System.out.println("挑选关键点菜:"); //打印出一句提醒客户开始选择
for (int i = 0; i
System.out.println(i 1 "." menus[i] prices[i] "元"); // 表明编号、名称和相匹配价钱
}
Scanner scanner=new Scanner(System.in); // 创建对象一个扫描软件,因为是java而非Python,因而减少了input函数这儿就需要选用Scanner来创建对象一个scanner去执行相对应工作中。 甚至你要String s=scanner();s是接受不了的。也有如何把字符流array string彼此间的数据信息传输呢?赶快去看Java IO流写文件流读文件流好好地理一理思想吧~
Int chooseNumber=scanner.nextInt(); // 把客户在console中“ 开展 nextInt方式看到chooseNumber” scaner便是协助本system的IO流data可以通过nextXXXx()创建对象 scaner也可以readLine() 存放string stringTokenizer() to split the data strgin from consoel/files....etc . 本code tail also can be use of switch case finally print out the result depend on u input like if else statement do...... message about usage of tools: you should know how to use them and when where why...etc......... Java is a bit rough for some newbie but once u set up your goal just go with urselve find something useful..... no matter it works or not just create one by one make sure it works then store those codes in somewhere back after made sure all thing are correct so that later times finding bugs will become easier.......... most importantly have fun life! Bring Java Back ! :))))) GR&CK!! 2018 Summer Vacation projects & LAB work done at home............... $$$$$$$$ ->$->$-