How to make a random number generator based off an equation.

Discussion in 'Java' started by luettke10, Apr 20, 2010.

  1. luettke10

    luettke10 New Member

    Joined:
    Mar 30, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    I need a program that will allow the user to input two numbers in the range of 1 to 120. The program would then take the two numbers and subtract the larger number from the smaller number. The number they equals would represent x in the equation .84x which would equal the % of the lower number then appearing. The percentage of the other number coming up would be 100% minus the percentage of the higher number coming up.
     
  2. virxen

    virxen New Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    0
    it would be better if you give 2 arithmetic examples.
     
  3. luettke10

    luettke10 New Member

    Joined:
    Mar 30, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    So say the first number they enter is "n" and the second is "x", its not possible to do % of "n" showing up equals .84(n-x) and then using the remaining percent for the second number x.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice