没有合适的资源?快使用搜索试试~ 我知道了~
假设你在业余时间经营一个会员制的CD出租销售店,需要一个管理程序:可以增加会员、删除会员,出租、销售,进货,统计等,请设计适当的功能,并实现该程序。 定义几个异常 l 在cd数量不足时,出租和销售cd时抛出数量不足异常 l 会员不存在时,删除会员将抛出会员不存在异常
资源推荐
资源详情
资源评论
package 出租CD;
import java.util.*;
import java.io.*;
public class Test {
public static void main(String[] args) {
VIPdo vipdo=new VIPdo();
CDdo cd=new CDdo();
Scanner scn = new Scanner(System.in);
VIP vip1=new VIP("vip1",1,1000);
vipdo.insertvip(vip1);
VIP vip2=new VIP("vip2",2,2000);
vipdo.insertvip(vip2);
CD cd1=new CD("cd1",1,10,1);
cd.insertCD(cd1);
CD cd2=new CD("cd2",2,12,2);
cd.insertCD(cd2);
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
try
{
outer:
while(true)
{
System.out.println("请按提示操作");
System.out.println("1 vip");
System.out.println("2 cd");
System.out.println("3 exit");
int flag1=scn.nextInt();
String read=null;
import java.util.*;
import java.io.*;
public class Test {
public static void main(String[] args) {
VIPdo vipdo=new VIPdo();
CDdo cd=new CDdo();
Scanner scn = new Scanner(System.in);
VIP vip1=new VIP("vip1",1,1000);
vipdo.insertvip(vip1);
VIP vip2=new VIP("vip2",2,2000);
vipdo.insertvip(vip2);
CD cd1=new CD("cd1",1,10,1);
cd.insertCD(cd1);
CD cd2=new CD("cd2",2,12,2);
cd.insertCD(cd2);
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
try
{
outer:
while(true)
{
System.out.println("请按提示操作");
System.out.println("1 vip");
System.out.println("2 cd");
System.out.println("3 exit");
int flag1=scn.nextInt();
String read=null;
switch(flag1)
{
case 1:
while(true)
{
System.out.println("1 vipPrint");
System.out.println("2 vipinsert");
System.out.println("3 vipdelete");
System.out.println("4 exit");
int flag2=scn.nextInt();
switch(flag2)
{
case 1:
vipdo.print();
break;
case 2:
System.out.println("enter the vip name");
read=br.readLine();
String name=read;
System.out.println("enter the vip number");
read=br.readLine();
int num=Integer.parseInt(read);
System.out.println("enter the vip price");
read=br.readLine();
double cdprice=Double.parseDouble(read);
VIP vip3=new VIP(name,num,cdprice);
vipdo.insertvip(vip3);
System.out.println("insert is successful");
break;
case 3:
{
case 1:
while(true)
{
System.out.println("1 vipPrint");
System.out.println("2 vipinsert");
System.out.println("3 vipdelete");
System.out.println("4 exit");
int flag2=scn.nextInt();
switch(flag2)
{
case 1:
vipdo.print();
break;
case 2:
System.out.println("enter the vip name");
read=br.readLine();
String name=read;
System.out.println("enter the vip number");
read=br.readLine();
int num=Integer.parseInt(read);
System.out.println("enter the vip price");
read=br.readLine();
double cdprice=Double.parseDouble(read);
VIP vip3=new VIP(name,num,cdprice);
vipdo.insertvip(vip3);
System.out.println("insert is successful");
break;
case 3:
剩余12页未读,继续阅读
资源评论
qq_39405339
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功