Please write a C++ program to draw a “heart” and share to your special one in special occasion.

To get the Solution, drop an email at [email protected]
Please feel free to send us your queries at: [email protected]
Problem Statement

Please write a C++ program to draw a “heart” and share to your special one in special occasion. The output of the program is below: Please use functions and loops for this program, rather than print out everything directly, therefore you are only allowed to use the following output syntax: cout << "*"; cout << " "; cout << endl; The heart can be sperate to two parts: 1. In the upper part, there are two trapeziums. \( \begin{array}{l}\star \star \star \quad \star \star \star \\ \star \star \star \star \star \star \star \star \star \star \ Line 1: 4 blanks, 3 stars, 9 blanks, 3 stars Line 2: 3 blanks, 5 stars, 7 blanks, 5 stars Line 5: 0 blanks, 11 stars, 1 blank, 11 stars 2. In the lower part, there is one inverted triangle. \( \begin{array}{l}\star \star \star \star \star \star \star \star \star \star \star \star \star \star \star \star \star \sta Line 1: 1 blank, 21 stars Line 2: 2 blanks, 19 stars Line 11: 11 blanks, 1 star To demonstrate the reusability of function, please write the program with the following step: In main function: 1. Initialize the number of blanks and stars in the first line of the upper part heart. 2. Initialize the number of blanks and stars in the first line of the lower part heart. 3. Write a loop to print out the upper part of the heart, in this loop: a. Call a function UpperHeart to print a line for the upper part of the heart. b. Adjust the number of blanks and stars to a suitable value for printing next line. 4. Write a loop to print out the lower part of the heart, in this loop: a. Call a function LowererHeart to print a line for the lower part of the heart. b. Adjust the number of blanks and stars to a suitable value for printing next line. In UpperHeart function: 1. Write a loop to print the first part of the blanks. 2. Write a loop to print the first part of the stars. 3. Write a loop to print the second part of the blanks. 4. Write a loop to print the second part of the stars. 5. End of a line. In LowererHeart function: 1. Write a loop to print the blanks. 2. Write a loop to print the stars. 3. End of a line.

To get the Solution, drop an email at [email protected]
Please feel free to send us your queries at: [email protected]