This is my code:
这是我的代码:
import java.text.DecimalFormat;
import java.util.Scanner;
public class JavaApplication3 {
public static void main(String[] args){
double baseDiamond, baseDiamondPrice, preDiamond, preDiamondPrice, baseDiamondCalc, finalECoins;
Scanner input = new Scanner(System.in);
System.out.print("What is your current Diamond Miner level? ");
preDiamondPrice = input.nextDouble();
System.out.print("Enter what diamondminer level ");
baseDiamondPrice = input.nextDouble();
while (baseDiamondPrice > 0) {
baseDiamondPrice = ((baseDiamondPrice * 500000) + 1000000);
baseDiamondPrice--;
}
while (preDiamondPrice > 0) {
preDiamondPrice = ((preDiamondPrice * 500000) + 1000000);
preDiamondPrice--;
}
baseDiamondCalc = (baseDiamondPrice - preDiamondPrice);
DecimalFormat dRemover = new DecimalFormat("0.#");
System.out.println("You need " +dRemover.format(baseDiamondCalc)+ " ecoins for diamond miner level "+dRemover.format(baseDiamondPrice)+".");
}}
import java.text.D