import java.util.Scanner;
public class KuCun{
public static void main(String[] args){
System.out.println(“——————手机库存清单——————–“);
System.out.println(“品牌 尺寸 价格 库存数”);
String miPhone=”mi8″;
double miSize=4.6;
int miPrice=2599;
int miCount=100;

String hoPhone=”ho10″;
double hoSize=5.2;
int hoPrice=2399;
int hoCount=1000;

String opPhone=”opR17″;
double opSize=5.6;
int opPrice=2999;
int opCount=10000;

Scanner show=new Scanner(System.in);
int num=show.nextInt();
switch(num){
case 1:
System.out.println(miPhone+” “+miSize+” “+miPrice+” “+miCount);
System.out.println(hoPhone+” “+hoSize+” “+hoPrice+” “+hoCount);
System.out.println(opPhone+” “+opSize+” “+opPrice+” “+opCount);

int totalCount=miCount+hoCount+opCount;
long totalMoney=(long)(miCount*miSize+hoCount*hoSize+opCount*opSize);

System.out.println(“总库存数”+totalCount);
System.out.println(“总金额”+totalMoney);
break;
case 2:
System.out.println(“退出”);
break;
default:
System.out.println(“请输入1或2”);
break;
}

}

}

版权声明:本文为WLeon原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/WLeon/p/10297490.html