Write a program that determines the offset address

Assignment Help Computer Engineering
Reference no: EM13691646

Question: Write a program that determines the offset address for an n-dimensional array (0 < n <= 4).  Assume an element size of 2.  The program should prompt the user to enter the following data:

row-major order or column-major order (R or C)

the number of dimensions for the array (a number)

the upper and lower bounds for each subscript

a set of subscripts

The program should output the total size of the array and the address offset for the selected subscript combination.  Allow the user to enter sets of subscripts until a -1 is entered. Terminate the program when a subscript of -1 is entered.  For example:

Enter (R)ow or (C)olumn major order (R or C): R

Enter the number of dimensions for the array: 3

Enter the upper and lower bounds for subscript 1: 1 4        

Enter the upper and lower bounds for subscript 2: 1 3

Enter the upper and lower bounds for subscript 3: 2 6

Enter a set of subscripts:        2 3 4

Offset to 2, 3, 4 is:     54

Array size is:  120

Enter a set of subscripts:        -1 -1 -1

Successful termination of program

Include comments in code section.

Reference no: EM13691646

Questions Cloud

Difference between a compiler and an interpreter : One difference between a compiler and an interpreter is a compiler is a program.
Give the chemical equation that describes the combustion : Problem- Give the chemical equation (including phases) that describes the combustion of butene, C4H8(g)
String copy and string concatenation functions : Write the string copy and string concatenation functions -  Append n characters from string2 to stringl by using pointer arithmetic
Calculate the equilibrium constant for the reaction : Problem- Using the value of Ksp for Ag2S, Ka1 and Ka2 for H2S, and Kf = 1.1 105 for AgCl2-, calculate the equilibrium constant for the following reaction. Ag2S(s) + 4 Cl-(aq) + 2 H+(aq) 2 AgCl2-(aq) + H2S(aq)
Write a program that determines the offset address : Write a program that determines the offset address for an n-dimensional array (0
The true concentration of the naoh would be : The student carefully washed the burette and rinsed it deionized water, but neglected to coat the sides of the burette with the NaOH solution before filling it for the titration. The titration required 25.24 mL of the NaOH solution. The true conce..
Write the mechanism for the hydroxide ion catalyzed reaction : Problem- Write the mechanism for the hydroxide ion catalyzed reaction between cyclopentanone and benzaldehyde.
Predict the diffusivity of heavier molecules : Problem- Predict the diffusivity of heavier molecules. How would hexane and HCl diffuse together. Explain in relation to Fick's Law and Hard Sphere Collision. Which one would work and why
Cations tested for the silver and aluminum : Problem- Two students performing the general unknown lab were told that their unknown would contain 4 cations. They first tested for the silver and aluminum, but found that another ion was present.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Evaluate the usability of the online questionnaire website

Write clearly and concisely about human-computer interaction topics using proper writing mechanics and technical style conventions.

  Name the guidelines and additional decisions which can be

question 1 which of the guidelines and additional decisions can be incorporated in an automatic statistical thesaurus

  Question1 images can be stored as lossless or lossy bitmaps

question1. images can be stored as lossless or lossy bitmaps. explain differences why are most photographic images

  Explain the importance of usability

What website design changes should be made to accommodate older online surfers.

  What are the benefits of software engineering

What is the appropriate justification for an employee that can be submitted to his/her business line to persuade to accept the study of software engineering.

  Explain a mechanism by which an operating system can

describe a mechanism by which an operating system can enforce limited transfer of capabilities.that is process a might

  Design a "hello world" program in java

Each of the threads must be able to communicate with other threads by sending messages to them. The communication should be purely distributed in the sense that no other shared object is available to threads besides of the Thread array workers.

  Questionassume that a risc machine uses 5 register windowsa

questionassume that a risc machine uses 5 register windows.a how deep can the process calls go before registers must be

  Different graphics files

Different graphics files were send via email from an unknown source to the suspect in an ongoing investigation.

  Give most popular ways today to code a database application

Embedded SQL applications tend to lack interoperatiliby. Applications might have to modified to work with other RDBMS ODBC applications do not need the explicit declaration and use of host variables.

  Write a function to add up and return sum of all numbers

Write a function to add up and return the sum of all the numbers in an array of int up to but not including the first 0 value. (Assume there is a 0 value in the array.)

  In the early 2000s cellular carriers would not allow phone

in the early 2000s cellular carriers would not allow phone manufactorers to include wifi connections on their phones.

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