Write a function called fibonacci

Assignment Help C/C++ Programming
Reference no: EM131137846

By definition, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two;

for example, the first 6 Fibonacci numbers are 0, 1, 1, 2, 3, 5.

Write a program that asks the user for a number between 5 and 11 (inclusive) and then displays that many Fibonacci numbers.

YOU MUST write a function called fibonacci which is called from main as follows:

if ((num < 5) || (num > 11)) cout "Please follow the directions!" endl; else { total = fibonacci(num); cout << endl; cout << "Total is "; cout << total; cout << endl; }

Note that the function adds up each of the Fibonacci numbers and returns the total to main.

Reference no: EM131137846

Questions Cloud

How do you perceive employment conditions : how do you perceive employment conditions?  - Does it seem like we'll have more structural problems in the future?
At what interest rate would this become attractive : Your company is looking at the possibility of replacing this loan with a loan that has estimated closing costs of $3,300.00. At what interest rate would this become attractive?
Determine the quantity of sand required : The sand in its loosest state has a porosity of 90% and the desired porosity, when compacted, is 20%. Assuming the average thickness of the completed island is 100 m, determine the quantity of sand required.
At what interest rate would this become attractive : Your company is looking at the possibility of replacing this loan with a loan that has estimated closing costs of $3,300.00. At what interest rate would this become attractive?
Write a function called fibonacci : By definition, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two;
A random sample of size n from a normal population : Given a random sample of size n from a normal population with μ = 0, use the Ney man-Pearson lemma to construct the most powerful critical region of size α to test the null hypothesis σ = σ0 against the alternative σ = σ1 > σ0.
The manufacturer of the new medication feels : Suppose that in Example 1 the manufacturer of the new medication feels that the odds are 4 to 1 that with this medication the recovery rate from the disease is 0.90 rather than 0.60. With these odds, what are the probabilities that he will make a..
If price of a good is set higher than equilibrium price is : If the price of a good is set higher than the equilibrium price: - Suppose that quantity supplied of a product equals 5 and quantity demanded equals 8. In this market, there is a:
The critical region of the likelihood ratio test : The number of successes in n trials is to be used to test the null hypothesis that the parameter θ of a binomial population equals 1/2 against the alternative that it does not equal 1/2.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd