Assignment #63 and Counting with a While Loop

Code

    /// Name: Lauren Baird
    /// Period: 7
    /// Program Name: Counting with a While Loop
    /// File Name: CountingWhile.java
    /// Date Finished: 11/4/2015
    
    import java.util.Scanner;
    
    public class CountingWhile
    {
    	public static void main( String[] args )
    	{
    		Scanner keyboard = new Scanner(System.in);
    
    		System.out.println( "Type in a message, and I'll display it several times." );
    		System.out.print( "Message: " );
    		String message = keyboard.nextLine();
            System.out.println( "How many times would you like your message to be displayed? " );
            int number = keyboard.nextInt();
    
    		int n = 0;
    		while ( n < number )
    		{
    			System.out.println( ((n+1)*10) + ". " + message );
    			n++;
    		}
            
            // n++ adds 1 to n whenever the loop runs
    
    	}
    }  
    

Picture of the output

Assignment #63