Advertisement
vp0415

lec4.5

Oct 31st, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class AsterisksGenerator {
  4.  
  5.     public static void main(String[] args) {
  6.        
  7.          Scanner input = new Scanner( System.in );
  8.          int number;
  9.         for (int i = 0; i < 5; i++) {
  10.              System.out.print("Please, Enter a number between 1 - 30 ");
  11.              number = input.nextInt();
  12.              for (int j = 0; j < number; j++)
  13.              {
  14.                  if(number > 30)
  15.                  {
  16.                     System.out.print("Fuck off"); break;
  17.                  }
  18.                  System.out.print("*");
  19.             }
  20.         }
  21.        
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement