Results 1 to 2 of 2
  1. #1
    Alicia is offline Member
    Join Date
    Oct 2009
    Posts
    4
    Rep Power
    0

    Default Can someone help me with this?

    This is one of my assignment for my java class:

    Write an application that creates and prints a random phone number of the form XXX - XXX - XXXX. Include the dashes in the output. Do not let the first three digits contain an 8 or a 9, and make second ser if three digits is not greater than 742

    Im so confused on how to startt.
    Please help

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    Here is a hint:

    Java Code:
    Random random = new Random();
          
    int r = random.nextInt(10);
    System.out.println("r: " + r);
    My Hobby Project: LegacyClone

Posting Permissions

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