Question: 2 . Egyptlan Pyramed ( 2 5 pointil. Let's build a pyramid with the help of a 2 - dimansional ( 2 D ) aray

2. Egyptlan Pyramed (25 pointil. Let's build a pyramid with the help of a 2-dimansional (2D) aray-
Long aga, some advancod divilzations such as the Egyplans modelad their architecture to be of pyramid form 3-Dimancionsl polyhodra with some base and triengle-shapod fat sibis moefing to a point at the top. For the saike of this sacigonment, we will be considsing 2-D pyrcamids, which tains th riangles. You wil be tasked with undorstanding and implementing 2D array(s) to cresta a 2-Dimorcional pyramid of your own
Overview
On rol During Profesaor Centono's 2D 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:
1. the oweral eles of their figure
2. the rumber of bricks providas-to build a pyramid.
Programming
The shudents ane expoctod to use a 20 amay to construct the pyramid. The pyramid is concticuctod uaing the charactors "(bricks) and "(no bribk)t-
- Bricks, donctad by the symbol ", are to be placod boginning at the bottom isf and continue untl bifier 1) there are no mon bricks ar 2) the pye complate.
- The surmuncing aroa is to be filed with the symbol ".
Once the 2D array (pyramid) ts conctructed print:
- the 2D array starting at mow and column anmo lo.jl].
Nots: Koop in mind that the output is expectad be PRINTED into the tarminal.
Programming
Example 1: Exocuing the command
produces a \(3\times 32\mathrm{D}\) grid with 1 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 2: Exociling the command
jear Leoticus, nowitits
produces \(24\times 42\mathrm{D}\) grid with 5 inital tribks to conctiuct the pyramid.
The output looks live this:
Example a: Exocuing the command
\[
\begin{array}{l}
\text { Javac ligutiallyraald. jone }\\
\text { jant Feortlabs, nowid }5\text { is }
\end{array}
\]
produces a \(5\times 52\mathrm{D}\) grid with 1 s initial bricks to construct the pyrmid. The o.tput looks like this:
2 . Egyptlan Pyramed ( 2 5 pointil. Let's build a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!