Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Both programs should be in C++ using #include only and preferably with comments a. Write a C++ program that asks the user to enter N,

Both programs should be in C++ using #include only and preferably with comments

image text in transcribed

a. Write a C++ program that asks the user to enter N, the program should then output the Fibonacci series. Use do-while loop to ask user to re-enter N if the user entered a number below 2. Hint: The first two numbers in the Fibonacci series are 0 and 1. [5 marks] Fo = 0 F1 = 1 Any Fibonacci number is equal to the summation of the two previous numbers Fn = Fn-1 + Fn-2 Therefore, F2 = F1 + F. = 1+0 = 1 F3 F2 + F1 = 1+1 = 2 F4 = Fz + F2 = 2 + 1 = 3 Fn = Fn-1 + Fn-2 Enter N: 20 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 b. Write a program that use loops to print the following patterns separately, one below the other. In your code use for, while and do-while loops to generate the patterns, use one loop for each question. (5 marks] ********** ******* AAAAA BBBB CCC DD E ***** *** *

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

AN ILLUSORY CONTRACT IS A VALID CONTRACT: True False

Answered: 1 week ago

Question

Comment on the pH value of lattice solutions of salts.

Answered: 1 week ago