public class Favorite {
public static void main(String[] arguments) {
String itemName = "Golden Beans";
double offerPrice = 314;
int sellPrice = 321;
double value = (sellPrice - offerPrice);
int cashStack = 500_000;
double percentageProfit = ((value / offerPrice) * 100);
System.out.println("Approx. Offer Price is " + offerPrice);
System.out.println("Approx. Sell Price is " + sellPrice);
System.out.println("The potential profit margin is " + value);
System.out.println("With a cash stack of " + cashStack + " we can buy " + cashStack / offerPrice + " " + itemName +"s");
System.out.println("The profit margin of " + itemName + " as a percentage is " + percentageProfit);
}
}
制作一个我决定买卖价格的小程序,它告诉我利润率。完毕
然后找出我可以用 500,000 购买多少件商品。完毕
然后通过让程序告诉我购买价格的利润来使其更高级。完毕
然后让程序输出到小数点后三位。(这就是我被卡住的地方!)
狐的传说
至尊宝的传说
相关分类