Question
Lets recreate that pyramid in JAVA, albeit in text, using hashes (#) for bricks, a la the below. Each hash is a bit taller than
Lets recreate that pyramid in JAVA, albeit in text, using hashes (#) for bricks, a la the below. Each hash is a bit taller than it is wide, so the pyramid itself is also be taller than it is wide.
The program well write will be called mario. And lets allow the user to decide just how tall the pyramid should be by first prompting them for a positive integer between, 1 and 8, inclusive.
Once you get your input processing to work properly, it might be easier to build the opposite pyramid first (left-aligned).
It turns out its a bit easier to build a left-aligned pyramid than right-, a la the below.
#
##
###
####
#####
######
#######
Lets now right-align that pyramid by pushing its hashes to the right by prefixing them with dots (i.e., periods), a la the below.
.......#
......##
.....###
....####
...#####
..######
.#######
########
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started