Implement modular C++ functions to print geometric star (*) patterns:
void printSquare(int size): Prints an n x n solid star grid.void printHollowRectangle(int width, int height): Prints a hollow rectangle where outer border cells are * and inner cells are spaces ( ).void printRightTriangle(int height): Prints a left-aligned right triangle of stars of given height.void printInvertedTriangle(int height): Prints an inverted right triangle.printSquare(4).printHollowRectangle(6, 4).printRightTriangle(5).printInvertedTriangle(4).=== Solid Square (4x4) === * * * * * * * * * * * * * * * * === Hollow Rectangle (6x4) === * * * * * * * * * * * * * * * * === Right-Angled Triangle (h=5) === * * * * * * * * * * * * * * * === Inverted Triangle (h=4) === * * * * * * * * * * [✓] 2D shape printing functions verified (Time: 0.007s, Memory: 2.1 MB)