Advertisement
scaawt

Lab07

Sep 24th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. /**
  2. * written by --
  3. */
  4. import java.util.Scanner;
  5.  
  6.  
  7. public class Lab07 {
  8.  
  9. public static void main(String[] args) {
  10. Scanner keyboard = new Scanner(System.in);
  11. System.out.println("Welcome to the Triangle Maker! Enter the size of a triangle!");
  12.  
  13. int length = keyboard.nextInt();
  14. int width = keyboard.nextInt();
  15. int height = keyboard.nextInt();
  16. /*{
  17. if(length <=0 || width <=0 || height <=0)
  18. System.out.println("Invalid.");
  19. System.exit(0);}
  20. */
  21.  
  22. for (int i = 0; i<length; i++)
  23. {
  24. for (int j = 0; j<width; j++)
  25. {
  26. for (int k = 0; k<height; k++)
  27. {
  28. System.out.print("*");
  29. }
  30. System.out.println();
  31.  
  32. }
  33. {
  34. System.out.println("Finished!");
  35. }
  36.  
  37.  
  38.  
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement