SlideShare a Scribd company logo
OP 3014
Assignment 02
Please read about the Fibonaccinumbers at
http://en.wikipedia.org/wiki/Fibonacci_number
thenwrite a program, and save it inlab02.cpp, that asks howmany
numbers it should generate inthe Fibonacciseries.
Remember that the first two numbers are
0 and 1
so youalreadyhave two numbers inthe series whenyoustart.
Please write a functionnamed Fibonaccithat takes anint indicating
the lengthofthe series. The functionprototype could look like
void Fibonacci( int length);
Use a localarrayofsize 20 to store the sequence ofnumbers and
thenprint the sequence inreverse order (largest number first);
display6 numbers per line and use 5 positions for eachnumber;
ifthe user asked for 20 numbers, your programshould display
4181 2584 1597 987 610 377
233 144 89 55 34 21
13 8 5 3 2 1
1 0
Your programshould make sure that lengththe series (i.e., the
int beingpassed to the Fibonaccifunction) is >= 2 and <= 20;
otherwise your programshould displaya message that lengthis out of
bounds and terminate the execution.
This assignment is due onthe BlackBoard bymidnight one week from
the dayit was assigned. Submit onlythe lab02.cpp file.
No late assignments.
Please
- use braces around anyblock
- use blocks as we did inour class examples
- indent your code as we have used indentations inour examples
- comment your code; do not over comment your code
Penalties:
o -2 for eachmissingblock
o -2 for eachmissingindentation
o no credit ifyour cpp file does not compile or does not run
o some partialcredit ifyour programcrashes withdifferent
input values dependingonthe problem
Extra credit:
- one extra point ifyour programcorrectlyallocates and deallocates
a dynamic arrayfor lengthelements instead ofusinga fixed size
arrayofsize 20 to hold the numbers inthe Fibonacciseries.
end oflab 02.
OP 3014  Assignment 02  Please read about the Fibonacci numbers at      http://en.wikipedia.org/wiki

More Related Content

PDF
Java programlist (1)
PDF
Lesson 10. Pattern 2. Functions with variable number of arguments
PDF
Format string
PPTX
Error correction-and-type-of-error-in-c
DOCX
Bitstuffing
PDF
Tutorial 04 (revised) (1)
PPTX
Basic concepts of python
PDF
Lab7: More Arrays, Strings, Vectors, and Pointers
Java programlist (1)
Lesson 10. Pattern 2. Functions with variable number of arguments
Format string
Error correction-and-type-of-error-in-c
Bitstuffing
Tutorial 04 (revised) (1)
Basic concepts of python
Lab7: More Arrays, Strings, Vectors, and Pointers

What's hot (17)

DOCX
programming concept
PPTX
Numbers and math module
PPS
C programming session 04
DOC
Md university cmis 102 week 5 hands
PDF
Python iteration
PDF
First program of C ( Complete Explanation )
PPTX
Binary expression tree
PDF
Python workshop
PPT
Control structures pyhton
PPT
1.4 expression tree
PPT
Computer notes - Expression Tree
PDF
Pointers c5
PDF
Lesson 9. Pattern 1. Magic numbers
PPTX
Ch8 Arrays
DOCX
Check the following function headers and locate as many errors you ca
PPT
Help with Pyhon Programming Homework
PPT
Creating a program from flowchart
programming concept
Numbers and math module
C programming session 04
Md university cmis 102 week 5 hands
Python iteration
First program of C ( Complete Explanation )
Binary expression tree
Python workshop
Control structures pyhton
1.4 expression tree
Computer notes - Expression Tree
Pointers c5
Lesson 9. Pattern 1. Magic numbers
Ch8 Arrays
Check the following function headers and locate as many errors you ca
Help with Pyhon Programming Homework
Creating a program from flowchart
Ad

Similar to OP 3014 Assignment 02 Please read about the Fibonacci numbers at http://en.wikipedia.org/wiki (20)

PDF
c++ exp 1 Suraj...pdf
DOCX
Write a recursive C++ function that inputs a nonnegative integer n an.docx
PDF
P3
PDF
02_positive_fibonacci.pdf
PDF
Fibonacci series c++
PDF
DeVry GSP 115 All Assignments latest
PDF
You will be implementing the following functions. You may modify the.pdf
PDF
Ch01 basic concepts_nosoluiton
PDF
Effective Algorithm for n Fibonacci Number By: Professor Lili Saghafi
PDF
062636636366363773737373733+73737733+7.pdf
PDF
PF LAB ASSIGNMENT
PDF
Recursion.pdf
PDF
C++ TUTORIAL 4
PPT
Functions123
PPT
Functions12
PPTX
C Programming Homework Help
PPTX
C++ Homework Help
PPT
User defined functions
PDF
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
PDF
Recursion examples
c++ exp 1 Suraj...pdf
Write a recursive C++ function that inputs a nonnegative integer n an.docx
P3
02_positive_fibonacci.pdf
Fibonacci series c++
DeVry GSP 115 All Assignments latest
You will be implementing the following functions. You may modify the.pdf
Ch01 basic concepts_nosoluiton
Effective Algorithm for n Fibonacci Number By: Professor Lili Saghafi
062636636366363773737373733+73737733+7.pdf
PF LAB ASSIGNMENT
Recursion.pdf
C++ TUTORIAL 4
Functions123
Functions12
C Programming Homework Help
C++ Homework Help
User defined functions
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
Recursion examples
Ad

Recently uploaded (20)

PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Institutional Correction lecture only . . .
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
GDM (1) (1).pptx small presentation for students
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Cell Structure & Organelles in detailed.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial disease of the cardiovascular and lymphatic systems
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
Renaissance Architecture: A Journey from Faith to Humanism
STATICS OF THE RIGID BODIES Hibbelers.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Institutional Correction lecture only . . .
Insiders guide to clinical Medicine.pdf
Final Presentation General Medicine 03-08-2024.pptx
01-Introduction-to-Information-Management.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Supply Chain Operations Speaking Notes -ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
GDM (1) (1).pptx small presentation for students

OP 3014 Assignment 02 Please read about the Fibonacci numbers at http://en.wikipedia.org/wiki

  • 1. OP 3014 Assignment 02 Please read about the Fibonaccinumbers at http://en.wikipedia.org/wiki/Fibonacci_number thenwrite a program, and save it inlab02.cpp, that asks howmany numbers it should generate inthe Fibonacciseries. Remember that the first two numbers are 0 and 1 so youalreadyhave two numbers inthe series whenyoustart. Please write a functionnamed Fibonaccithat takes anint indicating the lengthofthe series. The functionprototype could look like void Fibonacci( int length); Use a localarrayofsize 20 to store the sequence ofnumbers and thenprint the sequence inreverse order (largest number first); display6 numbers per line and use 5 positions for eachnumber; ifthe user asked for 20 numbers, your programshould display 4181 2584 1597 987 610 377 233 144 89 55 34 21 13 8 5 3 2 1 1 0 Your programshould make sure that lengththe series (i.e., the int beingpassed to the Fibonaccifunction) is >= 2 and <= 20; otherwise your programshould displaya message that lengthis out of bounds and terminate the execution. This assignment is due onthe BlackBoard bymidnight one week from the dayit was assigned. Submit onlythe lab02.cpp file. No late assignments. Please - use braces around anyblock - use blocks as we did inour class examples - indent your code as we have used indentations inour examples - comment your code; do not over comment your code Penalties: o -2 for eachmissingblock o -2 for eachmissingindentation o no credit ifyour cpp file does not compile or does not run o some partialcredit ifyour programcrashes withdifferent input values dependingonthe problem Extra credit: - one extra point ifyour programcorrectlyallocates and deallocates a dynamic arrayfor lengthelements instead ofusinga fixed size arrayofsize 20 to hold the numbers inthe Fibonacciseries. end oflab 02.