Question: I am using IntelliJ In this assignment you are to write a Java class called Pyramid. The purpose of this class is to enable me

 I am using IntelliJ In this assignment you are to write

a Java class called "Pyramid". The purpose of this class is to

I am using IntelliJ

In this assignment you are to write a Java class called "Pyramid". The purpose of this class is to enable me to draw pyramid-shaped objects (when viewed sideways) on the console. There is a single method called "draw" which takes one integer parameter, base, which is actually half the width of the base. For example, if I declare a Pyramid object P and then call its draw method, with the parameter 5, I should see the following on the output: Pyramid P = new Pyramid(); P.draw(5) results in: * It's important that you design your class (especially the draw() method) well; no unnecessary code and no brute-force cut and paste to get the job done. I don't want any artificial limit on the base parameter; I should be able to call your method with a base value of 200 if I want to. If the base value passed to the draw method is negative or zero, your method should do nothing

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 Databases Questions!