import java.io.*;
class AddUpAll
{
public static void main ( String[] args ) throws IOException
{
int value; // the value of the current integer
int limit; // the number of integers to add up
int sum = ________; // initialize sum
String line;
BufferedReader stdin = new BufferedReader(
new InputStreamReader( System.in ) );
// get the number of integers to add up
System.out.println("Enter how many integers:");
line = stdin.readLine();
limit = Integer.parseInt( line.trim() );
int count = ________; // initialize count
while ( count <= _______ )
{
System.out.println("Enter a number:");
line = stdin.readLine();
value = Integer.parseInt( line.trim() );
sum = ____________; // add to the sum
count = ____________; // increment count
}
System.out.println( "Grand Total: " + sum );
}
}
|