import java.util.Scanner;
class StoreList02 {
public static void main(String[] args) {
String macBrand = "MacBookAir"; //定义苹果品牌
double macSize = 13.3; //苹果尺寸
double macPrice = 6988.88; //苹果价格
String macConfig = "i5处理器4GB内存128G固态硬盘";//苹果配置
int macCount = 5; //库存数
String thinkBrand = "ThinkpadT450"; //定义Think品牌
double thinkSize = 14.0; //Think尺寸
double thinkPrice = 5999.99; //Think价格
String thinkConfig = "i5处理器4GB内存500G硬盘";//Think配置
int thinkCount = 10; //库存数
String asusBrand = "Asus_Fl580"; //定义华硕品牌
double asusSize = 15.6; //华硕尺寸
double asusPrice = 4999.5; //华硕价格
String asusConfig = "i7处理器4GB内存128G固态硬盘";//华硕配置
int asusCount= 18; //库存数
int totalcount = macCount+thinkCount+asusCount ; //总数
double totalmoney = (macPrice*macCount)+(thinkPrice*thinkCount)+(asusPrice*asusCount);//总价
System.out.println("..................................电脑商城库存清单 .....................");
System.out.println("品牌型号 尺寸 价格 配置 库存数");
System.out.println(macBrand+" "+macSize+" "+macPrice+" "+macConfig+" "+macCount);
System.out.println(thinkBrand+" "+thinkSize+" "+thinkPrice+" "+thinkConfig+" "+thinkCount);
System.out.println(asusBrand +" "+asusSize+" "+asusPrice+" "+asusConfig+" "+asusCount);
System.out.println("..........................................................................");
System.out.println("总库存数 :"+ asusCount);
System.out.println("总金额数 :"+ totalmoney );
}
}
|
|