Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Basic Java help

  1. #1
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Basic Java help

    In a file called BinaryStringPrinter.java write a method with the signature:
    public void printStrings(int len)throws IllegalArgumentException
    that uses recursion (either directly or indirectly) and prints all of the binary numbers, of length len in numerical order. So, for example, the call printStrings(4) must print:
    0000
    0001
    0010
    0011
    0100
    0101
    0110
    0111
    1000
    1001
    1010
    1011
    1100
    1101
    1110
    1111
    A call printStrings(0) must print an empty line. A call to printStrings with a parameter less than zero must throw an IllegalArgumentException.

  • #2
    Regular Coder
    Join Date
    Jan 2008
    Location
    Willow Grove, PA
    Posts
    169
    Thanks
    1
    Thanked 27 Times in 27 Posts
    Post what you have attempted to do so far and where you are having problems and someone should be able to help you find the problem.


  •  

    Posting Permissions

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