Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

12:53 1 Facebook CourseAssignment01 (1).docx The Problem Fibonacci numbers are a sequence of natural numbers. The first two Fibonacci number are by definition and the

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
12:53 1 Facebook CourseAssignment01 (1).docx The Problem Fibonacci numbers are a sequence of natural numbers. The first two Fibonacci number are by definition and the rest by the recurrence relation A list of the Fibonacci numbers up to 100 are given in the Appendix below. You are to write a MATLAB program that will calculate and display the Fibonacci numbers from 1 to 100. Programming Design Notice that you are given a statement of the problem, and it is up to you, the programmer, to turn the above statement into a program. In this assignment you will be provided with some guidance in to how to proceed, but you should understand that normally you will just be given a statement of the problem and it is up to you to decide how to design your program. To being, recall the basic components of programming: data types and structures. So the first thing you will have to decide is what data type to use. Since Fibonacci number are natural numbers we should use integers. And since we would like to calculate as many as possible, it would be best to use unsigned, 64- bit integers. In addition, there will be a hundred Fibonacci numbers so it may be advisable to use an array of 100 unsigned, 64 bit integers. Many programs involve sets of data, so the use of arrays is extremely common. To define an array of this size it is advisable to use the zeros MATLAB function (see reading list below). The next thing you need to decide is which structures to use. The Fibonacci recurrence relationship is based on using the previous two values to calculate the current one. Therefore to start the series the first two must be given by definition. So a sequence structure would be used for the first two. The recurrence relationship is an example of a repetition calculation and therefore you should consider a repetition, or looping, structure. In this case, if you use arrays, the standard repetition structure for arrays is the for-loop. Finally you want to display your data. Again, if you are using arrays, you would probably want to use a for- loop. In addition to control the way the data is displayed

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

Students also viewed these Databases questions