serhatyucell

week6lab2 rectangle

Oct 26th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class week6Lab2 {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner s = new Scanner(System.in);
  7.         System.out.println("Enter the x edge:");
  8.         int x = s.nextInt();
  9.         System.out.println("Enter the y edge:");
  10.         int y = s.nextInt();
  11.  
  12.        
  13.         for (int i = 1; i <= x; i++) {
  14.             for (int j = 1; j <= y; j++) {
  15.                 System.out.print("*");
  16.             }
  17.             System.out.println();
  18.         }
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment