Question: Trying to answer this in C++ uestion 2: Write a program that, prints a 'pine tree' consisting of triangles of increasing sizes, filled with a

Trying to answer this in C++

Trying to answer this in C++ uestion 2: Write a program that,

uestion 2: Write a program that, prints a 'pine tree' consisting of triangles of increasing sizes, filled with a character (eg,'*, or ,+'or'$, etc) Your program should interact with the user to read the number of triangles in the tree and the character filling the tree Your implementation should include the following functions a. void printShiftedTriangle (int n, int m, char symbol) It prints an n-line triangle, filled with symbol characters, shifted m spaces from the left margin. 4,+),the expected output For example, ifwe call printshiftedTriangle (3, is Left margin 4 spaces b. void printPineTree (int n, char symbol) It prints a sequence of n triangles of increasing sizes (the smallest triangle is a 2-line triangle), which form the shape of a pine tree. The triangles are filled with the symbol character For example, if we call printPineTree ( 3,# ) , the expected output is: Left

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!