Question: 2 . Egyptian Pyramid ( 2 5 points ) . Let s build a pyramid with the help of a 2 - dimensional ( 2
Egyptian Pyramid points Lets build a pyramid with the help of a dimensional D array.
Long ago, some advanced civilizations such as the Egyptians modeled their architecture to be of pyramid form: Dimensional polyhedra with some polygon base and triangleshaped flat sides meeting to a point at the top. For the sake of this assignment, we will be considering D pyramids, which take the form of triangles. You will be tasked with understanding and implementing D arrays to create a Dimensional pyramid of your own.
Overview
Oh no During Professor Centenos D Arrays lecture, a mysterious portal opened up right into the projected picture of the Egyptian pyramids, sucking all the CS students into another time dimension. It looks like the students are trapped in BC After some conversing lets assume due to advanced language translation technology that students happened to bring they discover that the Egyptians need assistance in building their pyramids. Since Professor Centeno did not time travel with the CS students, its now up to them to help these Egyptians out.
The students need to code a program that reads two command line arguments from the terminal representing:
the overall size of their figure
the number of bricks providedto build a pyramid.
Programming
The students are expected to use a D array to construct the pyramid. The pyramid is constructed using the characters Xbricks and no brick
Bricks, denoted by the symbol X are to be placed beginning at the bottom left and continue until either there are no more bricks or the pyramid is complete.
The surrounding area is to be filled with the symbol
Once the D array pyramid is constructed print:
the D array starting at row and column zero
the number of bricks remaining, in the format listed below.
Note: Keep in mind that the output is expected be PRINTED into the terminal.
Programming
Example : Executing the command
javac EgyptianPyramid.java
java EgyptianPyramid
produces a D grid with initial brick to construct the pyramid.
The output looks like this Note the placement of the brick is on the left side of the last row:
Example : Executing the command
javac EgyptianPyramid.java
java EgyptianPyramid
produces a D grid with initial bricks to construct the pyramid.
The output looks like this:
Example : Executing the command
javac EgyptianPyramid.java
java EgyptianPyramid
produces a D grid with initial bricks to construct the pyramid. The output looks like this:
Problem by Kushi Sharma and Ayla Muminovic
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
