Question: In Java Write a function to calculate a CSP number, which is defined as n(n+1)/2 for n = 1,2, ..., and so on. The first

In Java

Write a function to calculate a CSP number, which is defined as n(n+1)/2 for n = 1,2, ..., and so on.

The first few CSP numbers, also known as terms, would therefore be 1, 3, 6,10, 15....

If n = 1 the CSP number is 1, for example.

Your main program will prompt the user for the number of terms of CSP numbers to calculate and will send that as a parameter to the CSP number function.

The result will be printed on the screen from the CSP number function.

In addition, the CSP number function will sum all of the CSP terms the user requested and will return that value to main to be printed on the screen.

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!