Project 40

One - Dimensional Arrays (50 points)
Write an applet which will find the sum of the first n positive integers. Use a for loop to fill the integers into a one - dimensional array as follows :

num[0] = 1, num[1] = 2, num[2] = 3 ... num[n-1] = n.

Use a second for loop to find the sum, and a third to dump out the array list. Output each term in equation form with no more than five terms per line. The last term must not be succeded by a plus symbol. If a non positive integer is entered, make sure you output an error message. For example

Other Requirements:

Sample Output for Project40