Advertisement
CamiloCastilla

Untitled

Dec 11th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. package com.company;
  2. import java.util.Scanner;
  3. public class Main {
  4.  
  5.     public static void main( String[] args )
  6.         {
  7.             Scanner keyboard = new Scanner(System.in);
  8.  
  9.             System.out.println( "Type in a message, and I'll display it ten times." );
  10.             System.out.print( "Message: " );
  11.             String message = keyboard.nextLine();
  12.             System.out.println("How many times:");
  13.             int times=keyboard.nextInt();
  14.  
  15.             int n=1;
  16.             while ( n <= times )
  17.             {
  18.                 System.out.println( (n*10) + ". " + message );
  19.                n++;
  20.             }
  21.  
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement