Write program that fills two arrays with number sequence

Assignment Help Assembly Language
Reference no: EM13848580

This program uses Assembly Language and should be done with Visual Studio 2013A sequence of numbers is an ordered list of numbers that follow a certain rule. For example, the positive integers start at 1 and each one is found by adding a 1 to the previous number.

Mathematically, this can be written in a recurrent form as

yk = yk-1 + 1

which means, the current number is the previous number plus one, and the sequence looks like this: { 1,2,3,4,5,6,7,8,9, etc. }.

Another example is the Fibonacci numbers. Their mathematical form is

yk = yk-2 + yk-1

which means, the current number is the sum of the previous 2 numbers. The first two numbers are 0 and 1, and the sequence looks like this: { 0,1,1,2,3,5,8,13, etc. }.

There are many sequences that can be defined in many ways. For this project we will use the following sequence, that starts at 1:

yk = 2 yk-1 + 1
which means, the current number is the previous number times 2 plus one, and the sequence looks like this: { 1,3,7,15,31,63,127,255, etc. }.

The Project

Write a program that fills two arrays with the number sequence defined by the expression: yk = 2yk-1 + 1. The sequence starts at 1.

Here is what you have to do:

Declare two 10 element DWORD arrays, say array1 and array2.

Create a procedure called FillArray1. Calculate the first 10 numbers of the sequence and place them in array1.

Create a procedure called FillArray2. Calculate the next 10 numbers of the sequence and place them in array2.

Create a procedure called PrintArrays. With this, write a message to the screen "The arrays are: " and print the arrays in two columns, side by side, with a header for each array: Array 1 and Array 2. The first array should be displayed in yellow and the second array in green. After the arrays are displayed, bring back the screen font color to the default color of light gray, so that the message "Press any key to continue ..." will be displayed in that color. To change the text color, call the SetTextColor procedure from the book's library. You can find SetTextColor procedure in your textbook, Chapter 5.

In the main program call these 3 procedures. Therefore, the main program should be very simple:

call FillArray1

call FillArray2

call PrintArrays

Very important: Do not hardcode numbers in your procedures. Do not increment the arrays with hard numbers. As we did in previous labs, use the SIZEOF, TYPE, and LENGTHOF operators to make the program as flexible as possible to support the array size and type being changed in the future.

Reference no: EM13848580

Questions Cloud

Even though most corporate bonds : Even though most corporate bonds in the United States make coupon payments semiannually, bonds issued elsewhere often have annual coupon payments. If the yield to maturity is 8.1 percent, what is the current price of the bond?
District has bonds outstanding with coupon rate : Union Local School District has bonds outstanding with a coupon rate of 3.7 percent paid semiannually and 26 years to maturity. The yield to maturity on these bonds is 4.3 percent and the bonds have a par value of $10,000. What is the price of the bo..
What is the research problem the paper attempts to address : What is the research problem the paper attempts to address
Change in depreciation affect net income in current year : Assume you work as an assistant accountant in the head office of a national movie rental business, a la Blockbuster Inc. With the increasing popularity of online movie rental operations, your company has struggled to meet its earnings targets for the..
Write program that fills two arrays with number sequence : Calculate the first 10 numbers of the sequence and place - Write a program that fills two arrays with the number sequence defined by the expression.
Describe how you would make two l of glycine buffer : Describe how you would make 2L of a 0.1M glycine buffer, pH 9, using glycine and 1.0M NaOH. For glycine the pKa is 9.6.
Breakeven analysis procrastinators anonymous : Breakeven Analysis Procrastinators Anonymous (PA) is hosting their annual convention this coming year in Dallas, TX. Although this is not typical of this organization, they wish to plan ahead to determine what the cost of the keynote banquet ticket s..
The expected return on any asset is dependent upon its beta : The expected return on any asset is dependent upon its beta. Explain what Beta is, why it is used and its relevance to investment decisions.
Calculate the amount of budgeted purchases : The pizza is expected to cost $4 per pizza. It expects to pay 70% in the month of purchase and the remainder in the following month. Calculate the amount of budgeted purchases for its first quarter.

Reviews

Write a Review

Assembly Language Questions & Answers

  Write a program in assembly language which uses bios

write a program in assembly language which uses bios interrupt int 21 to read current system time and displays it on

  Problems does an assembler have to overcome

What problems does an assembler have to overcome in order to produce complete binary code with only one pass over the source code? How would code written for a one-pass assembler be different from code written for a two-pass assembler?

  Modify the single-cycle mips processor

Modify the single-cycle MIPS processor to implement one of the following instructions. Sec Appendix B for a definition of the instructions. Mark up a copy to indicate the changes to the datapath. Name any new control signals.

  In this project you will build an 8088 assembler the job

in this project you will build an 8088 assembler. the job of your assembler is to turn 8088 assembly code i.e. the

  1 complete the following tables using hexadecimalnbsp

1. complete the following tables using hexadecimalnbsp numbers only

  Write an assembly language program that has two subroutines

write an assembly language program that has two subroutines one for encrypting alphabates of a string and second fo

  Pseudo-code in assembly language

Implement the following pseudo-code in assembly language (assume unsigned numbers). Declare Apple and Pear as byte sized variables.

  Write an assembly program in mips that get the array size

Write an assembly program in mips that get the array size from the keyboard, then reads a list of integers from the keyboard and writes the sorted list in ascending order to the console screen.

  Prepare an assembly program that reads in a number of cents

prepare an assembly program that reads in a number of cents. the program will write out the number of dollars and cents

  Documented assembly language program

Write a complete well documented assembly language program (starts at $C000) that counts the number of 1s in each byte in a list. The LIST_IN starts at $C100

  Write an assembly language program using the pep8 assembler

Write an assembly language program using the PEP8 assembler (free download) that corresponds to the following C++ program

  Mips assembly instruction to set the pc

Is it possible to use the jump (j) MIPS assembly instruction to set the PC to the address as 0x4000 0000 and Is it possible to use the branch-on-equal (beq) MIPS assembly instruction to set the PC to this same address?

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