practice: printing shapes with loops

Write a program that prints out the following shapes. For each shape, you may use up to one of each of these print statements: cout << '*';, cout << ' ';, and cout << '\n' (or endl instead of '\n') unless otherwise specified. You may use as many loops and integer variables as you want, but don't cast anything to another type. The shapes start easy and gradually get more difficult, with the last few being very difficult especially if you don't have some experience with graphing, algebra, and trigonometry. I recommend keeping the code for each shape as you go.

*****

*
*
*
*
*

*****
*****
*****
*****
*****

*
**
***
****
*****

*****
****
***
**
*

    *
    *
    *
    *
    *

*****
*   *
*   *
*   *
*****

    *
   **
  ***
 ****
*****

*****
 ****
  ***
   **
    *

Hint for the diamond and half-diamond shapes below: use the absolute value function.

*
**
***
****
*****
****
***
**
*

    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *

Extra challenge: create a circle of radius 10 centered at (30, 20) by using
cout << "\x1b[" << y << ";" << x << "H";
This line of code will move the cursor to the coordinates specified by
the x and y variables! In this coordinate system, y increases downwards.
The circle will look more like an oval because each character takes up a
rectangular space.

          *
      *********
     **       **
   **           **
   *             *
  *               *
 **               **
 *                 *
 *                 *
 *                 *
**                 **
 *                 *
 *                 *
 *                 *
 **               **
  *               *
   *             *
   **           **
     **       **
      *********
          *

If you're stuck, you can see the solutions in C++ here.