Cora Dyce

Welcome to our website !
Please register an account to view the complete categories and forums.

Cora Dyce - Your personal dicing clan


    Need help with java!

    Share

    DukeNukem12
    Member
    Member

    Posts : 1
    Join date : 2014-04-15

    Need help with java!

    Post by DukeNukem12 on 2014-04-15, 02:04

    Hey guys! I'm trying to learn java myself and found just java exercise website called "Practice It!" and I'm stuck on this exercise and was wondering if someone can give me the code so I can study it and learn why it is the answer.

    Here is the exercise:

    Write a method named hopscotch that accepts an integer parameter for a number of "hops" and prints a hopscotch board of that many hops. A "hop" is defined as the split into two numbers and then back together again into one.  0 hops is a board up to 1; one hop is a board up to 4; two hops is a board up to 7; and so on.

    For example, hopscotch(3); should print:

    Code:
       1
    2     3
       4
    5     6
       7
    8     9
       10


    Thanks guys!

      Current date/time is 2017-09-25, 20:53