Jump to content
SubSpace Forum Network

Recommended Posts

Posted

If you want to be able to multiple shipowner money calculations that don't stop at 10k, use this. Here is the code (Java):

 

import javax.swing.JOptionPane;
  public class moneycalc
  {
     public moneycalc()
     {
     }
     public static void main(String[] args)
     {
        String bounty1 = JOptionPane.showInputDialog("Killer Bounty?");
        String bounty2 = JOptionPane.showInputDialog("Killee Bounty?");
        int bty1 = Integer.parseInt(bounty1);
        int bty2 = Integer.parseInt(bounty2);
        int killmoney = (int)(50.0 * ((((float) bty2 + 5.0) / ((float) bty1 + 5.0)) + 1.0));
        String money = "Money earned: $" + killmoney + ".";
     
        System.out.println(money);
     }   
  }

Posted

I don't know java so I'm not gonna write java code

But something like this should get rid of X/0 problems

Have the code check killerbty for a 0 bounty then force a killerbty=killerbty+1 into the money calculation if possible

×
×
  • Create New...