Advertisement
Guest User

FullCode

a guest
Dec 16th, 2012
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.43 KB | None | 0 0
  1. import javax.swing.*;
  2.  
  3.  
  4. public class LotteryOdds{
  5.     public static void main(String args[]){
  6.         String sNumbers = JOptionPane.showInputDialog("Enter in the amount of possible numbers: \n");
  7.         int iNumbers = Integer.parseInt(sNumbers);
  8.         String sBalls = JOptionPane.showInputDialog("Enter in the amount of balls taken: \n");
  9.         int iBalls = Integer.parseInt(sBalls);
  10.         int iFactorialA = 1;
  11.         int iFactorialB = 1;
  12.         int iTest = 0;
  13.         int iFact = 1;
  14.         int iTotal = 1;
  15.         int iCount = 0;
  16.         int iCountA = iBalls;
  17.  
  18.  
  19.  
  20.         do{
  21.             int iNumber = iNumbers;
  22.             iTotal = iNumbers * (iNumber -1);
  23.            iNumbers--;
  24.            iCountA--;
  25.            }while(iCountA > 0);
  26.  
  27.            System.out.println("The circumference is: " + iTotal + " ");
  28.  
  29.         /*for(int iCount = iBalls; iCount > 1; iCount-- && iNumbers--){
  30.              iTest = iNumbers;
  31.              iFactorialA = (iNumbers - iCount);
  32.              iFact = (iTest * iFactorialA);
  33.         }
  34.         */
  35.         for(iCount = iBalls; iCount > 1 ; iCount--){
  36.             iFactorialB *= iCount;
  37.         }
  38.  
  39. System.out.println("The circumference is: " + iFactorialB + " ");
  40.  
  41. //JOptionPane.showMessageDialog(null,
  42. //                           iTotal+ "               " + iFactorialB,
  43. //                           "Prime Numbers - Killian O'Brien",
  44. //                           JOptionPane.INFORMATION_MESSAGE);
  45.  
  46.  
  47.             //JOptionPane.showMessageDialog(null,
  48.             //                            "The Prime Numbers Are: \n" + sPrime  + //"\n",
  49.             //                            "Prime Numbers - Killian O'Brien",
  50.             //                            JOptionPane.INFORMATION_MESSAGE);
  51. //
  52.  
  53.         }
  54.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement