Question: There are two ways to write an LMC program that tests if an input number is an Fibonacci number (i.e. part of the Fibonacci sequence).

There are two ways to write an LMC program that tests if an input number is an Fibonacci number (i.e. part of the Fibonacci sequence). If the number is, output 100, if the number is not, output 99.

1. Compute all the Fibonacci numbers below 1000 (the mailboxes are 3 digit only), store them in memory, then compare the input number with them in a loop.

2. Compute the each Fibonacci numbers and compare with the input number as you go.

Write the above two programs and put them in one code file and upload.

Test each of the above two programs using the LMC simulator, and take a picture of the output. Put both picutures in a google or word doc, and upload as your test file.

3.. Attach a google doc that answers the following question: Which one uses more memory? Which one is faster? Is there any way you can think of that can make this process faster?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!