public class demo{
public static void main(String[] args){
//1 顶部
System.out.println("----------------商城库存清单------------------------------------------------");
System.out.println("品牌 尺寸 价格 库存数量");
//2 品牌
String macBrand = "MacBookAir";
double macSize = 15.6;
double macPrice = 9888.3;
int maccount = 6;

String ThinkBrand = "ThinkPadT450";
double ThinkSize = 15.6;
double ThinkPrice = 19888.3;
int thinkcount = 2;

String MiBrand = "ThinkPadT450";
double MiSize = 15.6;
double MiPrice = 19888.3;
int Micount = 10;
//3 打印中部
System.out.println(macBrand+" "+macSize+" "+macPrice+" "+maccount);
System.out.println(ThinkBrand+" "+ThinkSize+" "+ThinkPrice+" "+thinkcount);
System.out.println(MiBrand+" "+MiSize+" "+MiPrice+" "+Micount);
int total = maccount+thinkcount+Micount;
double totalPrice = maccount*macPrice+ThinkPrice*thinkcount+Micount*MiPrice;
//4 打印底部
System.out.println("库存总数"+total);
System.out.println("库存总价格"+totalPrice);

 







}

相关文章:

  • 2021-12-06
  • 2022-01-05
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2022-12-23
  • 2021-12-28
  • 2021-08-02
  • 2021-09-16
  • 2022-12-23
  • 2022-02-19
  • 2021-10-31
相关资源
相似解决方案