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

  Prepare a program in mips assembly language

Prepare a program in MIPS assembly language that reads in a sequence of signed 32-bit integers (words) and return the maximum, the minimum, and the median value of the input sequence.

  Microcontroller assembly language programs

Write the following 8051 Microcontroller assembly language programs and simulate your programs in EDSIM 51 simulation

  Provide the rtl instructions

Provide the RTL instructions and the time steps that will facilitate the execution of the following assembly language instructions  LDA addr,x  STX addr,x

  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.

  Write two arm assembly language subroutines

Write two ARM assembly language subroutines, called output_char and read_char.

  Part a clockuse a timer interrupt to design a simple

part a clockuse a timer interrupt to design a simple digital clock. this clock will count only minutes and seconds

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language code segment to insert

Write an assembly language code segment to insert into the main.asm file that takes an input controlled by a potentionmeter, converts that input to a digital value, and displays that value on the LEDs according to the following

  Write an isr and startup code for a system that lights up le

Write an ISR and startup code for a system that lights up LED0 on the PSoC Eval1 board (assuming that a wire is connecting P1[0]) to indicate "Low Voltage"

  Write a single arm assembly language instruction equivalent

Write a single ARM assembly language instruction equivalent to a function that takes in three strings and checks if any are a substring to one another, if so return 1, if not return 0.

  Write an assembly language version

write an assembly language version of the following c code segment

  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

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