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

  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