Create a method!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jonel
    New Member
    • Oct 2007
    • 1

    #1

    Create a method!

    I want a method that has parameter int[] num...

    The int[] num will be consisting of numbers...

    for example: int[] num = {1, 2, 3, 5, 1, 1, 1, 1};

    the element 0 is a number inside box 1...
    the element 1 is a number inside box 2...
    the element 2 is a number inside box 1...
    the element 3 is a number inside box 1...
    the element 4 is a number inside box 1...
    the element 5 is a number inside box 1...

    The program should return 1 because all the elements are inside the box 1;

    Would you like to create that for me?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by jonel
    I want a method that has parameter int[] num...

    The int[] num will be consisting of numbers...

    for example: int[] num = {1, 2, 3, 5, 1, 1, 1, 1};

    the element 0 is a number inside box 1...
    the element 1 is a number inside box 2...
    the element 2 is a number inside box 1...
    the element 3 is a number inside box 1...
    the element 4 is a number inside box 1...
    the element 5 is a number inside box 1...

    The program should return 1 because all the elements are inside the box 1;

    Would you like to create that for me?
    No. But we'd like to help you create that for yourself.

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      Originally posted by jonel
      I want a method that has parameter int[] num...

      The int[] num will be consisting of numbers...

      for example: int[] num = {1, 2, 3, 5, 1, 1, 1, 1};

      the element 0 is a number inside box 1...
      the element 1 is a number inside box 2...
      the element 2 is a number inside box 1...
      the element 3 is a number inside box 1...
      the element 4 is a number inside box 1...
      the element 5 is a number inside box 1...

      The program should return 1 because all the elements are inside the box 1;

      Would you like to create that for me?
      Is the rule: if all numbers are odd the method should return 'true' otherwise 'false'?

      kind regards,

      Jos

      Comment

      Working...