Assignment #63 Counting with a While Loop

Code

    /// Name: Koosha Kimelman
    /// Period: 7
    /// Program Name: Counting with a While Loop
    /// File Name: CountingWhile.java
    /// Date Completed: 11/9/15
    
    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 some number of 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+1)*10) + ". " + message);
                x++;
            }
        }
    }
    

Picture of the output

Assignment 63