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);
}
}
|
|