Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91231138

Have any Question?


Related Questions in Computer Engineering

Suppose in your company you formulate a python script that

Suppose in your company you formulate a Python script that inserts, updates, and deletes data in tables in a MySQL database. You post your Python script on a shared drive for other staff members to use. What are some the ...

The decomposition of so2cl2 is first order in so2cl2 and

The Decomposition of SO2Cl2 is first order in SO2Cl2 and has a rate constant of 1.42*10-4s-1 at a certain temperature. What is the half-life for this reaction?

Determine the mass of the water by using the waters density

Determine the mass of the water by using the water's density (specific to the initial temperature) and the volume of the water. Remember,  density = mass/volume . You can look up the density of the water at your specific ...

Question research microwave serices and report on what

Question : Research microwave serices and report on what kinds of applications can be supported, what equipment will be necessary, where the equipment will be located, and what services these companies that offers.

On a certain banking machine customers arrive at an average

On a certain banking machine customers arrive at an average of 15 per hour. a) What is the probability that 12 customers will use the machine in the next hour? b) What is the probability that there will be fewer than 3 c ...

Not all context free grammars define regular languages

Not all context free grammars define regular languages. However, the following two DO define regular languages. For each grammar below, (a) describe the corresponding language and (b) draw the corresponding finite state ...

Select one of the discussion topics and respond begin your

Select one of the discussion topics and respond. Begin your response by indicating which question you chose. Discussion topics: Section 1 Should the government set a maximum wage? Why or why not? Section 2 Most people be ...

Fully explain at least one reason why many developing

Fully explain at least one reason why many developing countries suffered serious debt crisis in the early 1980s. Does this reason you explained in debt support Krueger & Srinivasan's argument? Why or why not? How could t ...

Question 1 page referencesthat respond to the following

Question: 1 page / references That respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your classmates. Be substantive and clear, and use exam ...

You are the senior information security manager for a

You are the senior information security manager for a federal agency. You received a phone call from an employee stating that his laptop was stolen from his workstation. He tells you that the laptop has at least 20 cases ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As