Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

=+Have you been arrested?

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago