Assignment #88 Adding Values with a for loop

Code

    /// Name: DeeJay Cerezo
/// Period: 7
/// Program Name: ForAdding
/// File Name: ForAdding.java
/// Date Finished: 2/29/2016

import java.util.Scanner;

public class ForAdding
{
    public static void main( String[] args )
    {
        Scanner keyboard = new Scanner(System.in);
        int total = 0, num;
       
        do 
        {
        System.out.println( "I will add up the numbers you give me." );
        System.out.print( "Number: " );
        num = keyboard.nextInt();
        total = total + num;
        } while ( num != 0 );
        System.out.println( "Total: " + total);
            
    }
}




    

Picture of the output

Assignment 88