Question: Write a public method named findSum that takes a a parameter named n of type int. If n is less than 1 the method returns

 Write a public method named findSum that takes a a parameter

Write a public method named findSum that takes a a parameter named n of type int. If n is less than 1 the method returns - 1 otherwise it returns a number that is the result of applying the following formula to i values ranging from 1 to n: Note: I is the symbol for summation. n 2 n(n + 1) 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!