Assignemnt #63 and Counting While
Code
///Name: Dakota Donahue
///Period: 5
///Project Name: Counting While
///File Name: CountingWhile.java
///Date: 1/12/2016
//1. n++ keeps track of counting for the program
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? " );
times = keyboard.nextInt();
int n = 0;
while ( n < times )
{
System.out.println( (n+1) + ". " + message );
n++;
}
}
}