Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, karleebowling316
Asuccessful format string attack attempted to steal user account information by reading from unauthorized memory. answer the followings with proper explanation a)this attack will lead to violation of which security policies?
Answers: 2
image
Computers and Technology, 22.06.2019 08:30, gg68814
1.the index finger on your right hand types the f r v 4 j u m 7 h y 6 n lo.9 j u 7 m g t 5 b 2.if you need to multiply 400, 2, and 1 ½, what would you type on the numeric keypad? 400*2*1.5 400/2*1.5 400/2/1.5 400*2*1½ 3.select all examples of proper keyboarding technique. rest your fingers gently on the home row or home keys. slouch in your chair. rest your palms on the keyboard. relax your fingers. keep your hands lower than your elbows.
Answers: 1
image
Computers and Technology, 22.06.2019 17:00, Janznznz1121
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
image
Computers and Technology, 22.06.2019 22:00, suewignall
During physical science class ben and jerry connected three identical lightbulbs in parallel to a battery where happens when ben removes one of the lightbulbs from it’s socket
Answers: 2
Do you know the correct answer?
Write a program that, prints a ‘pine tree’ consisting of triangles of increasing sizes, filled with...

Questions in other subjects:

Konu
Geography, 02.02.2021 01:00