Assignment #63
Code
///jack newsom
///period 5
///program name CountingWhile
///filename CountingWhile.java
///date completed 10/7/15
import java.util.Scanner;
public class CountingWhile
{
public static void main( String[] args)
{
Scanner bot = new Scanner(System.in);
System.out.println("Type in a message, and I'll display it several times.");
System.out.println("Message: ");
String msg = bot.next();
System.out.println("How many times?");
int num = bot.nextInt();
int n = 0;
while ( n < num )
{
System.out.println(10*(n+1) + ". " + msg );
n++;
}
}
}
Picture of the output