Write parameterized C++ functions to construct centered geometric figures:
void printPyramid(int height): Prints a centered equilateral triangle where row i (from 1 to height) has height - i leading spaces followed by 2 * i - 1 stars.void printDiamond(int n): Prints a symmetric diamond with n upper rows (including center) and n - 1 lower rows.void printHourglass(int n): Prints an hourglass figure composed of an inverted pyramid followed by an upright pyramid.printPyramid(4).printDiamond(4).printHourglass(4).=== Centered Pyramid (h=4) === * *** ***** ******* === Symmetric Diamond (n=4) === * *** ***** ******* ***** *** * === Hourglass Pattern (n=4) === ******* ***** *** * *** ***** ******* [✓] Advanced geometric pattern functions verified (Time: 0.007s, Memory: 2.1 MB)