continue working on the program about a loop and a sum calculation. Only now your loop should
Fantastic news! We've Found the answer you've been seeking!
Question:
continue working on the program about a loop and a sum calculation. Only now your loop should be in a separate method, this method should take a parameter, a number that you enter from the keyboard.
- need to Create a method getSum to include a FOR loop inside
- Get a scanner and input a number form the keyboard in main(). The method will take one parameter and calculate the sum up to that number. For example, if you pass 5, it it will calculate 1+2+3+4+5 and will return it back to main() method. Main method should call the method, get the sum back, and print a sum. You call the method from main() and get the result back to main() the method.
Related Book For
Posted Date: