Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building The Data Warehouse

Authors: W. H. Inmon

4th Edition

0764599445, 978-0764599446

More Books

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago