/******************************************************************************
* Name:
* NetID:
* Precept:
*
* Description: This program takes a command-line argument N and prints
* the sum (1 + 2 + ... + N).
*
* Examples:
* > java FiniteSum 1
* 1
* > java FiniteSum 2
* 3
* > java FiniteSum 10
* 55
******************************************************************************/
public class FiniteSum {
public static void main(String[] args) {
// read in first command-line argument
int N = ________________;
// this variable is your running sum
int sum = 0;
// write a for-loop to calculate 'sum'
// print 'sum'
}
}
// Answer on page 57 of the book!