Shapes #1: Pyramid Figure

Published by MrDrProfessor in

Write a Java program that produces the following outputs.

Examples

pyramid(2) ➞
////\\\\
********
pyramid(3) ➞
////////\\\\\\\\
////********\\\\
****************
pyramid(4) ➞
////////////\\\\\\\\\\\\
////////********\\\\\\\\
////****************\\\\
************************

Notes

  • Only positive integers >= 2.
  • Last line ending should contain \n
Watch a quick demo on how Edabit works.