JcGaming

Creating a Reverse Pyramid Activity Week 7 by John Carl Quieta

Oct 25th, 2022
1,007
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | Source Code | 0 0
  1. /**
  2.  * Activity Week 7 by John Carl Quieta
  3.  * Create a Program that looks like pyramid but the shape is reverse
  4.  * Quieta_week7
  5.  */
  6. public class Quieta_week7 {
  7.  
  8.     public static void main(String[] args) {
  9.         int Pyramid = 10;
  10.         int i = Pyramid;
  11.         while (i > 0) {
  12.             // for spacing
  13.             for (int blank = 0; blank < (Pyramid - i) / 2; blank++) {
  14.                 System.out.print(" ");
  15.             }
  16.             // for asterisk
  17.             for (int j = 0; j < i; j++) {
  18.  
  19.                 System.out.print("*");
  20.             }
  21.             // prints the strings of asterisk and spacing
  22.             System.out.println();
  23.  
  24.             // formula for creating the shape
  25.             i = i * 2 / 3;
  26.         }
  27.     }
  28. }
  29. // Submitted by John Carl Quieta
  30. // October 25, 2022
Advertisement
Add Comment
Please, Sign In to add comment