Assignment #63 Counting with a While Loop

Code

    /// Name: Matthew Lorence
    /// Period: 5
    /// Program Name: Counting While
    /// File Name: CountingWhile.java
    
    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.print("How many times? ");
            int n = keyboard.nextInt();
    
    		int x = 0;
    		while ( x < n )
    		{
    			System.out.println( (x+10) + ". " + message );
    			x=x+10;
                n=n+9;
    		}
    
    	}
    }
        
        
        
    

Picture of the output

Assignment 63