Question: 2 . Egyptlan Pyramed ( 2 5 pointil. Let's build a pyramid with the help of a 2 - dimansional ( 2 D ) aray
Egyptlan Pyramed pointil. Let's build a pyramid with the help of a dimansional D aray
Long aga, some advancod divilzations such as the Egyplans modelad their architecture to be of pyramid form Dimancionsl polyhodra with some base and triengleshapod fat sibis moefing to a point at the top. For the saike of this sacigonment, we will be considsing D pyrcamids, which tains th riangles. You wil be tasked with undorstanding and implementing D arrays to cresta a Dimorcional pyramid of your own
Overview
On rol During Profesaor Centono's D Arrays lecture, a myaterioua portal opened up right into the projoctod picture of the Egrptian pyramids, suckin
The shudents neod to code a program that rasos two command line arguments from the tarminal mercaenting:
the oweral eles of their figure
the rumber of bricks providasto build a pyramid.
Programming
The shudents ane expoctod to use a amay to construct the pyramid. The pyramid is concticuctod uaing the charactors bricks and no bribkt
Bricks, donctad by the symbol are to be placod boginning at the bottom isf and continue untl bifier there are no mon bricks ar the pye complate.
The surmuncing aroa is to be filed with the symbol
Once the D array pyramid ts conctructed print:
the D array starting at mow and column anmo lojl
Nots: Koop in mind that the output is expectad be PRINTED into the tarminal.
Programming
Example : Exocuing the command
produces a times mathrmD grid with ininal brick to construct the pyramid.
The output looks live this Note the placoment of the trick is on the laft side of the last row:
mithesery
theta Bricks Renaining Bricks Renaining
Example : Exociling the command
jear Leoticus, nowitits
produces times mathrmD grid with inital tribks to conctiuct the pyramid.
The output looks live this:
Example a: Exocuing the command
beginarrayl
text Javac ligutiallyraald. jone
text jant Feortlabs, nowid text is
endarray
produces a times mathrmD grid with s initial bricks to construct the pyrmid. The otput looks like this:
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
