viewing paste Unknown #15796 | Java

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
package main;
 
import java.util.Random;
 
import javax.swing.JOptionPane;
 
public class main {
    
    public static void main(String [] args){
        double sday = 1000000;
        Random rm = new Random();
        int xday  = rm.nextInt(1000000) + 500000;
        double inf = 0;
        System.out.println("Money: " + xday);
        while(Integer.parseInt(JOptionPane.showInputDialog("1 or 0")) == 1){
            int WhitePotion = 1200;
            inf = xday/sday;
            System.out.println(inf + ":" + xday + "/" + sday);
            WhitePotion = (int) (WhitePotion * inf);
            System.out.println(WhitePotion);
            xday = xday - (Integer.parseInt(JOptionPane.showInputDialog("How many WhitePotion do you want to buy?")) * WhitePotion) + rm.nextInt(100000);
            System.out.println("Money: " + xday);
        }
    }
}
//Simulates Infaltion with WhitePotion
Viewed 592 times, submitted by Guest.