Assignemnt #72 Again with the Number-Guessing
Code
//Tyler Hart
//period 5
//Again with the Number-Guessing
//CountingWhile.java
//11/18/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." );
System.out.print( "Message: " );
String message = keyboard.nextLine();
System.out.println( "How many times?" );
int n2 = keyboard.nextInt();
int n = 0;
do
{
System.out.println( (n+1) + "0. " + message );
n++;
//incresses n by one
}while ( n < n2 );
}
}
Picture of the output