★ D1st0rt Posted February 7, 2004 Report Posted February 7, 2004 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); } } _UU___UU__SSSSS____AAA____UU___UU__SSSSS____AAA____UU___UU_SS_______AAAAA___UU___UU_SS_______AAAAA___UU___UU__SSSSS__AA___AA__UU___UU__SSSSS__AA___AA__UU___UU______SS_AAAAAAA__UU___UU______SS_AAAAAAA___UUUUU___SSSSS_AA____AA___UUUUU___SSSSS_AA____AAJ.C. Dento> prime example of why america will never be a world super power.Moscato> d1 is mad he will never have a job outside subspaceI can't see this because I turned signatures off. ps VT
Manual Posted February 8, 2004 Report Posted February 8, 2004 Hey i learned that in Java class SST Network AdministratorSST Forever Dying Owner http://www.tehseen.net/manual.gif
Dr Brain Posted February 9, 2004 Report Posted February 9, 2004 Doesn't have all the checks it needs. Doesn't check for devide by zero is an obvious one. Freedom is the right to be wrong.
FunkmastaD Posted February 9, 2004 Report Posted February 9, 2004 I don't know java so I'm not gonna write java codeBut something like this should get rid of X/0 problemsHave the code check killerbty for a 0 bounty then force a killerbty=killerbty+1 into the money calculation if possible The more the light shines through meI pretend to close my eyes.The more the dark consumes meI pretend I'm burning bright.
★ D1st0rt Posted February 10, 2004 Author Report Posted February 10, 2004 it shouldn't need that because you shouldn't be stupid and put stuff in that will break it. Besides, it adds the 5.0 _UU___UU__SSSSS____AAA____UU___UU__SSSSS____AAA____UU___UU_SS_______AAAAA___UU___UU_SS_______AAAAA___UU___UU__SSSSS__AA___AA__UU___UU__SSSSS__AA___AA__UU___UU______SS_AAAAAAA__UU___UU______SS_AAAAAAA___UUUUU___SSSSS_AA____AA___UUUUU___SSSSS_AA____AAJ.C. Dento> prime example of why america will never be a world super power.Moscato> d1 is mad he will never have a job outside subspaceI can't see this because I turned signatures off. ps VT
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now