Write a program to calculate fibonacci numbers

Assignment Help Computer Engineering
Reference no: EM132217431

Written in MASM Assembly

Problem Definition:

Write a program to calculate Fibonacci numbers.

• Display the program title and programmer's name. Then get the user's name, and greet the user.

• Prompt the user to enter the number of Fibonacci terms to be displayed. Advise the user to enter an integer in the range [1 .. 46].

• Get and validate the user input (n).

• 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.

• Display a parting message that includes the user's name, and terminate the program.

Requirements:

1) The programmer's name and the user's name must appear in the output.

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 main procedure must be modularized into at least the following sections (procedures are not required this time):

a. introduction

b. userInstructions

c. getUserData

d. displayFibs

e. farewell

5) Recursive solutions are not acceptable for this assignment. This one is about iteration.

6) The upper limit should be defined and used as a constant.

Notes:

1) It is not necessary to store the Fibonacci numbers in an array. The terms may be displayed as they are generated.

2) The second-order Fibonacci sequence is defined as:

a. The first two terms are both 1.

b. All other terms are calculated as the sum of the two previous terms.

c. The reason for restricting n to [1 .. 46] is that the 47th Fibonacci number is too big for DWORD data type.

Example:

Fibonacci Numbers
Programmed by Leonardo Pisano
What's your name? Paul
Hello, Paul
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? 14
1 1 2 3 5
8 13 21 34 55
89 144 233 377
Results certified by Leonardo Pisano.

Reference no: EM132217431

Questions Cloud

Hiring practices for truck drivers racially discriminatory : Are Wal- Mart’s recruiting and hiring practices for truck drivers racially discriminatory?
Analyzes the matter in a manner consistent : The purpose of this course shall be to engage in significant research and study of a particular matter which is not readily available in a traditional course.
Research how the organization manages its customer base : Research how the organization manages its customer base (survey, direct mail, social media, etc.).
What potential economic and health indicators : What potential economic and health indicators could be expected if a federal law requiring paid leave were implemented?
Write a program to calculate fibonacci numbers : Calculate and display all of the Fibonacci numbers up to and including the nth term. Write a program to calculate Fibonacci numbers.
Marketing manager of well-known automobile engine additive : The marketing manager of a well -known automobile engine additive suspects that the use of an in-store display affects the price elasticity of his product.
Advantages associated with holding certified check : Advantages associated with holding a certified check include all of the following, except:
Writing a literature review using given information : Before you can begin to write a literature review, you must spend a substantial amount of time reviewing the literature to locate the articles.
Critically analyse the marketing of a selected brand : Critically analyse the marketing of a selected brand or category (defined as '... a class or division of people or things regarded as having particular shared

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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