Question: Please use c++ and explain the code please. thanks mestions The Fibonacci numbers sequence, F is defined as follows: Fis 1. Fis 1, and F

Please use c++ and explain the code please. thanks Please use c++ and explain the code please. thanks mestions The Fibonacci

mestions The Fibonacci numbers sequence, F is defined as follows: Fis 1. Fis 1, and F F forn=3.4.5.- In other words, each number is the sum of the previous two numbers. The first 10 numbers in Fibonacci sequence are: 1.1,2,3,5,8,13, 21, 34, 55 Note: Background of Fibonacci sequences en her 1. Write a function int fib (int n) that returns then-th element of the Fibonacci sequence 2. Write a program that prompts the user to enter a positive integer num, and then prints the num's elements in the Fibonacci sequence. Your program should interact with the user exactly as it shows in the following example: Please enter a positive integer 7 Question? Write a program that, prints a "pine tree consisting of triangles of increasing Sed with a character (egor''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 avoid printShifted Triangle(int n, int n, char symbol) It prints an n-line triangle, filled with symbol characters, shifted spaces from the left margin For example, if we call printshiftedTriangle (3, 4, +"), the expected output b. vaid peint Pine Tree (int n, char symbol It prints a sequence of triangles of increasing sizes (the smallest trade 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 printPine Tree (3, 3). the expected output is

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!