Assignemnt #79

Code

/// Name: Sam Menar
/// Period: 6
/// Program Name: Counting For
/// File Name: CountingFor.java
/// Date Finished: 2/23/2015

import java.util.Scanner;
public class TenTimes
{
    public static void main( String[] args )
    {
        Scanner keyboard = new Scanner(System.in);
        
        System.out.println("Type in a message, and I'll display it ten times.");
        System.out.print("Message: ");
        String message = keyboard.nextLine();
        
        for ( int n = 1 ; n <= 10; n = n + 1 )
            System.out.println( n + ". " + message );
        //1. n=n+1 makes n bigger each time so that the loop can end when n = 5
        //2. int n = 1 declairs the variable n
    }
}
                
                
                

            


    

Picture of the output

Assignment 13