欢迎来到天天文库
浏览记录
ID:14326700
大小:41.00 KB
页数:13页
时间:2018-07-27
《java迷你dvd管理器》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、java迷你DVD管理器publicclassMain{publicstaticvoidmain(String[]args){DVDdvd=newDVD();dvd.chushi();dvd.caidan();}}importjava.util.Date;importjava.util.Scanner;importjava.text.ParseException;importjava.text.SimpleDateFormat;importjava.util.Calendar;publicclassDVD{
2、String[]name=newString[50];int[]state=newint[50];String[]date=newString[50];int[]count=newint[50];Scannerin=newScanner(System.in);intxuhao;intk=3;booleanflag=true;////初始化程序//voidchushi(){this.name[0]="罗马假日";this.state[0]=0;this.count[0]=1;this.date[0]="201
3、2-01-11";this.name[1]="风声鹤唳";this.state[1]=1;this.name[2]="浪漫满屋";this.state[2]=1;}////主菜单程序//voidcaidan(){System.out.print("欢迎使用迷你DVD管理器---------------------------------------"+"1.新增DVD2.查看DVD3.删除DVD4.借出DVD5.归还DVD6.排行榜7.退出"+"-------------
4、-------------------------请选择:");this.xuanze();}voidxuanze(){xuhao=in.nextInt();switch(xuhao){case1:this.zengjia();break;case2:this.chakan();break;case3:this.shanchu();break;case4:this.jiechu();break;case5:this.guihuan();break;case6:this.paihang();break;c
5、ase7:this.jieshu();break;default:System.out.print("对不起,您的输入有误!请输入1—7:");this.xuanze();}}////返回程序//voidfanhui(){System.out.print("输入0返回主菜单:");xuhao=in.nextInt();if(xuhao==0){System.out.println("-------------------------------");this.caidan();}else{System.ou
6、t.print("输入有误,");this.fanhui();}}////新增DVD程序//voidzengjia(){System.out.print("----------------------------------------->新增DVD"+"请输入DVD名称:");Stringdv=in.next();for(inti=0;i7、int("按任意数字重新输入;按0返回:");xuhao=in.nextInt();if(xuhao==0){System.out.println("-------------------------------------");this.caidan();}else{this.zengjia();}}}if(flag==true){this.name[k]=dv;this.state[k]=1;System.out.println("新增DVD《"+this.name[k]+"》成功!");k++;Sys8、tem.out.print("按任意数字继续添加;按0返回:");xuhao=in.nextInt();if(xuhao==0){System.out.println("-------------------------------------");this.caidan();}else{this.zengjia();}}}////查看DVD程序//voidchakan(){System.out.println(
7、int("按任意数字重新输入;按0返回:");xuhao=in.nextInt();if(xuhao==0){System.out.println("-------------------------------------");this.caidan();}else{this.zengjia();}}}if(flag==true){this.name[k]=dv;this.state[k]=1;System.out.println("新增DVD《"+this.name[k]+"》成功!");k++;Sys
8、tem.out.print("按任意数字继续添加;按0返回:");xuhao=in.nextInt();if(xuhao==0){System.out.println("-------------------------------------");this.caidan();}else{this.zengjia();}}}////查看DVD程序//voidchakan(){System.out.println(
此文档下载收益归作者所有