Question: 2 Egyptlan Pyramed ( 2 5 pointal. Let's build a pyramid with the help of a 2 - dimansional ( 2 D ) aray. Long
Egyptlan Pyramed pointal. Let's build a pyramid with the help of a dimansional D aray.
Long ago, some advancod divilzations such as the Egyplans modelad their architecture to be of pyramid form Dimancionsl polyhodra with some trangles. You wil be tasked with understanding and implementing D arrays to cresta a Dimarcional pyramid of your own
Overview
The shudents neod to code a program that rasos two command line arguments from the tarminal meresenting:
the oweral elen of their flgure
the rumber of bricks providasto build a pyramid.
Programming compiate:
The surmuncing aroa is to be filed with the symbol"
Once the D array Pyramid ts conctructod print:
the D array starting at mow and column anmo lodJ
Note: Koop in mind that the output is expectad be PRINTED into the tarminal.
Programming
Example : Exowiting the command
produces a times mathrmD grid with ininal brick to construct the pyramid.
The output looks live this Note the placoment of the brick is on the laft side of the last row:
migereser
theta Bricks Renaining Bricks Renaining
Example : Exociling the command
produces times mathrmD grid with initial tribks to conctruct the pyramid.
The output looks live this:
Example a: Exomiting the command
produces a times mathrmD grid with s initital bricks to construct the pyrmid. The output 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
