Results 1 to 3 of 3
  1. #1
    danielmessick is offline Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    0

    Unhappy Java servlet class ??

    Hey all, how do i generate two random numbers between 1 and 10 inclusive and displays the result of their addition, subtraction, multiplication and division??

    For example, something such as:

    3 + 3 = 6

    3 - 3 = 0

    3 * 3 = 9

    3 / 3 = 1

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    Again, also posted at A Java servlet class ? - Java answers

    @OP: I think you'll make more headway if you post your code describe the problem you are having with it.

  3. #3
    nigamsir is offline Member
    Join Date
    Mar 2010
    Posts
    11
    Rep Power
    0

    Default

    Random generator = new Random();
    generator.nextInt(10) + 1
    store num in var
    perform +-*/

Similar Threads

  1. Replies: 14
    Last Post: 05-28-2009, 06:44 AM
  2. how can i link html+servlet+xml to form servlet
    By balachandarr in forum Java Servlet
    Replies: 0
    Last Post: 04-15-2009, 05:06 PM
  3. Replies: 1
    Last Post: 12-02-2008, 01:23 AM
  4. Replies: 0
    Last Post: 08-30-2008, 12:52 PM
  5. Replies: 1
    Last Post: 08-07-2007, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •