java做 项目案例:迷你DVD管理器 为什么新增的数据在查看里显示为空 那位大神帮忙弄下?非常感谢
publicclassDVD{staticintordernumber[]=newint[100];//定义接收序号的数组staticStringstatus[]=new...
public class DVD {
static int ordernumber[]=new int [100];//定义接收序号的数组
static String status[]=new String [100];//状态
static String name []=new String [100];//名称
static String date[]=new String [100];//日期
static Scanner sc=new Scanner(System.in);
static int i=3;
public static void main(String[] args) {
System.out.println("欢饮使用迷你DVD管理器");
String round ="y";//控制while循环
while(round.equals("y")){
System.out.println("**********************");
System.out.println("0.查看排行榜\n"+
"1.新增DVD\n"+
"2.查看DVD\n"+
"3.删除DVD\n"+
"4.借出DVD\n"+
"5.归还DVD\n"+
"6.退出");
System.out.println("**********************");
System.out.println("请选择");
int select=sc.nextInt();//switch选择
switch(select){
case 0:
ranking();
break;
case 1:
newlyincreased();
break;
case 2:
lookover();
break;
case 3:
delete();
break;
case 4:
loan();
break;
case 5:
sendback();
break;
case 6:
round="n";
break;
}
}
System.out.println("谢谢使用!");
}
public static void newlyincreased(){//新增
i++;
System.out.println("--->新增DVD");
System.out.println("请输入DVD名称:");
status[i]="可借";
name[i]=sc.next();
System.out.println("新增《"+name[i]+"》成功!");
}
public static void lookover(){//查看
System.out.println("--->查看DVD");
System.out.println("序号\t"+"状态\t"+"名称\t"+"借出日期");
status[0]="已借出";
status[1]="可借";
status[2]="可借";
name[0]="罗马假日";
name[1]="风声鹤鸠";
name[2]="浪漫满屋";
date[0]="2013-4-1";
for(int x=0;x<i;x++){
ordernumber[x]=x+1;
System.out.println(ordernumber[x]+"\t"+status[x]+"\t"+("《"+name[x]+"》")+"\t"+date[x]);
}
System.out.println("************************");
}
public static void delete(){//删除
}
public static void loan(){//借出
}
public static void sendback(){//归还
}
public static void ranking(){//排行榜
}
} 展开
static int ordernumber[]=new int [100];//定义接收序号的数组
static String status[]=new String [100];//状态
static String name []=new String [100];//名称
static String date[]=new String [100];//日期
static Scanner sc=new Scanner(System.in);
static int i=3;
public static void main(String[] args) {
System.out.println("欢饮使用迷你DVD管理器");
String round ="y";//控制while循环
while(round.equals("y")){
System.out.println("**********************");
System.out.println("0.查看排行榜\n"+
"1.新增DVD\n"+
"2.查看DVD\n"+
"3.删除DVD\n"+
"4.借出DVD\n"+
"5.归还DVD\n"+
"6.退出");
System.out.println("**********************");
System.out.println("请选择");
int select=sc.nextInt();//switch选择
switch(select){
case 0:
ranking();
break;
case 1:
newlyincreased();
break;
case 2:
lookover();
break;
case 3:
delete();
break;
case 4:
loan();
break;
case 5:
sendback();
break;
case 6:
round="n";
break;
}
}
System.out.println("谢谢使用!");
}
public static void newlyincreased(){//新增
i++;
System.out.println("--->新增DVD");
System.out.println("请输入DVD名称:");
status[i]="可借";
name[i]=sc.next();
System.out.println("新增《"+name[i]+"》成功!");
}
public static void lookover(){//查看
System.out.println("--->查看DVD");
System.out.println("序号\t"+"状态\t"+"名称\t"+"借出日期");
status[0]="已借出";
status[1]="可借";
status[2]="可借";
name[0]="罗马假日";
name[1]="风声鹤鸠";
name[2]="浪漫满屋";
date[0]="2013-4-1";
for(int x=0;x<i;x++){
ordernumber[x]=x+1;
System.out.println(ordernumber[x]+"\t"+status[x]+"\t"+("《"+name[x]+"》")+"\t"+date[x]);
}
System.out.println("************************");
}
public static void delete(){//删除
}
public static void loan(){//借出
}
public static void sendback(){//归还
}
public static void ranking(){//排行榜
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询