benjiharrison15

Members
  • Content count

    2
  • Joined

  • Last visited

  1. Consider the sequence of digits from 1 through N (N<=9) in increasing order: 1 2 3 4 ... N Insert either a '+' (for addition) or a '-' (for subtraction) between each of the digits so that the resultant sum is zero. Print all possible combinations that sum to zero. Example: Enter number: 7 1+2-3+4-5-6+7=0 1+2-3-4+5+6-7=0 1-2+3+4-5+6-7=0 1-2-3-4-5+6+7=0 Example: Enter number: 4 1-2-3+4=0 How do you do this in JAVA?????
  2. How do you draw this using recursion in Java? (the photo attached)