黑马程序员技术交流社区
标题:
超市报价单
[打印本页]
作者:
冰雪丝阳
时间:
2015-12-6 23:20
标题:
超市报价单
public class MyFruit {
public static void main(String[] args) {
int lAccount = 1;
int aAccount = 2;
int mAccount = 3;
String lName = "榴莲";
String aName = "苹果";
String mName = "猕猴桃";
double lPrice = 32.0;
double aPrice = 6.5;
double mPrice = 6.0;
String lUnit = "公斤";
String aUnit = "公斤";
String mUnit = "公斤";
int lNum = 2;
int aNum = 3;
int mNum = 5;
char lLevel = 'A';
char aLevel = 'A';
char mLevel = 'A';
double amount = lPrice * lNum + aPrice * aNum + mPrice * mNum ;
System.out.println("水果编号 水果名称 水果单价 计价单位 数量 品质");
System.out.println(" "+lAccount+" "+lName+" "+lPrice+" "+lUnit+" "+lNum+" "+lLevel);
System.out.println(" "+aAccount+" "+aName+" "+aPrice+" "+aUnit+" "+aNum+" "+aLevel);
System.out.println(" "+mAccount+" "+mName+" "+mPrice+" "+mUnit+" "+mNum+" "+mLevel);
System.out.println(" 总价:"+amount);
}
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2