subject

Write a program that, prints a ‘pine tree’ consisting of triangles of increasing sizes, filled with a character (‘*’ or ’+’ or ‘$’ etc). your program should consist of three functions: 1. a function print_shifted_triangle(n, m, symbol). it prints an n-line triangle, filled with symbol characters, shifted m spaces from the left margin. for example, if we call print_shifted_triangle(3, 4, `+`), the expected output is: + +++ 2. a function print_pine_tree(n, 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 print_pine_tree(3, `#`), the expected output is: # ### # ### # ### 3. a main() function that interacts with the user to read the number of triangles in the tree and the character filling the tree.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
Which of the following is not a symptom of chronic fatigue syndrome
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Match the items with their respective descriptions.
Answers: 1
You know the right answer?
Write a program that, prints a ‘pine tree’ consisting of triangles of increasing sizes, filled with...
Questions
question
History, 17.12.2020 19:10
question
Mathematics, 17.12.2020 19:10
question
History, 17.12.2020 19:10
question
Mathematics, 17.12.2020 19:10
Questions on the website: 13722363