Computers and Technology

Write a MASM program to calculate Fibonacci numbers:
1. Display the program title and your name. Then get the user's name and greet the user.
2. Prompt the user to enter the number of Fibonacci terms to be displayed. Advice the user to enter an integer in the range [1 - 46).
3. Get and validate the user input.
4. Calculate and display all of the Fibonacci numbers up to and including the nth term. The results should be displayed 5 terms per line with at least 5 spaces between terms.
5. Display a goodbye message that includes the user's name and terminates the program.
Requirements:
1. The main procedure must be divided into the following sections:
a. Introduction
b. User instructions
c. Get the data
d. Calculate and display Fibonacci numbers
e. Say goodbye
2. The loop that implements data validation must be implemented as a post-test loop.
3. The loop that calculates the Fibonacci terms must be implemented using the MASM loop instruction.
4. The upper and lower limits should be defined as constants
5. All the requirements regarding documentation, readability, user-friendliness apply.
Notes:
1. You can display the Fibonacci numbers as they are generated. You don't need to store them.
2. The first two Fibonacci terms are both 1. All other terms are the sum of the two previous terms. E. g. term-3 = term-1 + term-2
Example execution (user input is in italics):
Fibonacci Numbers
Programmed by Leonardo Pisano
What's your name? Jerry
Hello, Jerry
Enter the number of Fibonacci terms to be displayed
Give the number as an integer in the range (1 .. 46).
How many Fibonacci terms do you want? 50
Out of range. Enter a number in [1 ..46]
How many Fibonacci terms do you want?
1 2 3 4 5
8 13 21 34 55
89 144 233 377
Results certified by Leonardo Pisano.
Goodbye, Jerry

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:30, sumayyahjj
An attribute on a webpage allows you to set borders and change background colors. true or false
Answers: 1
image
Computers and Technology, 22.06.2019 12:40, dkjfghdjk
In a response of approximately 50 words, explain why it would be essential for the successful a/v technician to participate in additional coursework, presentations and seminars offered by equipment manufacturers as well as annual conferences attended by colleagues in the industry.
Answers: 1
image
Computers and Technology, 25.06.2019 05:10, jennynmike03
What is the output of the following program? #include using namespace std; class bclass { public: void print() const; bclass(int a = 0, int b = 0); //postcondition: x = a; y = b; private: int x; int y; }; class dclass: public bclass { public: void print() const; dclass(int a = 0, int b = 0, int c = 0); //postcondition: x = a; y = b; z = c; private: int z; }; int main() { bclass bobject(2, 3); dclass dobject(3, 5, 8); bobject. print(); cout < < endl; dobject. print(); cout < < endl; return 0 ; } void bclass: : print() const { cout < < x < < " " < < y < < endl; } bclass: : bclass(int a, int b) { x = a; y = b; } void dclass: : print() const { bclass: print(); cout < < " " < < z < < endl; } dclass: : dclass(int a, int b, int c) : bclass(a, b) { z = c; }
Answers: 3
image
Computers and Technology, 25.06.2019 15:30, penny3109
Finally, think about a way to add 1 to the score each time the ball touches the edge of the stage. see if you can add this to the project. answer quickly
Answers: 1
Do you know the correct answer?
Write a MASM program to calculate Fibonacci numbers:
1. Display the program title and your na...

Questions in other subjects:

Konu
Mathematics, 30.10.2020 18:10