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 08:00
What best describes a career pathway in a lodging career? a worker starts out as an amusement attendant, then becomes a recreation worker, and then becomes a gaming worker within five years. a worker starts out as a bell hop, then becomes a night clerk, and then becomes a hotel manager within five years. a worker starting out as a tour guide, then becomes a travel clerk, and then becomes a travel agent within five years. a worker starts out as a server, then becomes a food preparer, and then becomes a head chef within five years.
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
1. technician a says horsepower information can be used by consumers to compare the power of different automobile engines. technician b says that manufacturers will often list the horsepower output of their engines in the online service information. who is right?
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
Which of the following is not contained on the slide show toolbar? a. next button b. slide button c. close button d. pen tool
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
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
Spanish, 11.10.2019 13:50
question
History, 11.10.2019 13:50
Questions on the website: 13722362