Assignemnt #63
Code
/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: CountingWhile Program
/// File Name: CountingWhile.java
/// Date Finished: 9/9/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" );
System.out.print( "Message: " );
String message = keyboard.nextLine();
int l = 0;
System.out.println("How many times?");
System.out.print("Amount?: ");
l = keyboard.nextInt();
int n = 10;
while ( n < l )
{
System.out.println( (n+1) + ". " + message );
n = n + 10;
}
}
}
Picture of the output