Question: Write a function drawPyramidUpsideDown to draw (print on the screen) a pyramid upside down. This function receives an integer value that determines the number of

Write a function drawPyramidUpsideDown to draw (print on the screen) a pyramid upside down. This function receives an integer value that determines the number of asterisks on the first line, then two asterisks will be removed each time where one asterisk will be printed on the last line. The function accepts both even and odd numbers. When an odd number is passed to the function no changes are needed, however, if an even number is passed to the function it is converted to an odd number by adding 1 to it. (sample print out when 4 or 5 is passed to the function) ***** *** *

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!