黑马程序员技术交流社区
标题:
大神帮忙看看我想用键盘录入我的库存数还有配置该怎么录
[打印本页]
作者:
javaEE陈江
时间:
2016-3-11 17:52
标题:
大神帮忙看看我想用键盘录入我的库存数还有配置该怎么录
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 );
}
}
作者:
gaoxiang933
时间:
2016-3-11 18:36
{:2_31:} 128G固态硬盘肯定不够用呀!!!
作者:
javaEE陈江
时间:
2016-3-11 20:08
gaoxiang933 发表于 2016-3-11 18:36
128G固态硬盘肯定不够用呀!!!
这不是重点
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2