Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Activity Week 7 by John Carl Quieta
- * Create a Program that looks like pyramid but the shape is reverse
- * Quieta_week7
- */
- public class Quieta_week7 {
- public static void main(String[] args) {
- int Pyramid = 10;
- int i = Pyramid;
- while (i > 0) {
- // for spacing
- for (int blank = 0; blank < (Pyramid - i) / 2; blank++) {
- System.out.print(" ");
- }
- // for asterisk
- for (int j = 0; j < i; j++) {
- System.out.print("*");
- }
- // prints the strings of asterisk and spacing
- System.out.println();
- // formula for creating the shape
- i = i * 2 / 3;
- }
- }
- }
- // Submitted by John Carl Quieta
- // October 25, 2022
Advertisement
Add Comment
Please, Sign In to add comment