首页 > 代码库 > java基础4

java基础4


package
dvdpackage; import java.util.Scanner; public class main { public static void main(String[] args) { // TODO Auto-generated method stub int bt1; Scanner input = new Scanner(System.in); do{System.out.println("??欢迎使用迷你DVD管理系统??"); System.out.println("------------------"); System.out.println("?1.新增DVD"); System.out.println("?2.查看DVD"); System.out.println("?3.删除DVD"); System.out.println("?4.借出DVD"); System.out.println("?5.归还DVD"); System.out.println("?6.退出DVD管理系统"); System.out.println("-------------------"); System.out.println("请选择功能!"); bt1=input.nextInt(); switch (bt1) { case 1:System.out.println("新增DVD"); System.out.println("请输入电影名"); input.next(); do{System.out.println("新增完成,按0返回");bt1 =input.nextInt();} while(bt1!=0); break; case 2:System.out.println("查看DVD"); System.out.println("请输入要查看电影的片名"); input.next(); do{System.out.println("查看完成,按0返回");bt1 =input.nextInt();} while(bt1!=0); break; case 3:System.out.println("删除DVD"); System.out.println("输入要删除的电影名字"); input.next(); do{System.out.println("删除完成,按0返回");bt1 =input.nextInt();} while(bt1!=0); break; case 4:System.out.println("借出DVD"); System.out.println("输入借出电影的名字"); input.next(); do{System.out.println("查看借出完成,按0返回");bt1 =input.nextInt();} while(bt1!=0); break; case 5:System.out.println("归还DVD"); System.out.println("输入归还影片的名字"); input.next(); do{System.out.println("归还完成,按0返回");bt1 =input.nextInt();} while(bt1!=0); break; case 6:System.out.println("退出DVD"); System.out.println("真的退出吗"); return; default:System.out.println("输入错误,重新输入"); break; }}while(true); } }

 

 

java基础4