Write a program to test the class myarray.

Assignment Help Operating System
Reference no: EM13943188

Please assist with the following problem. I am totally lost with this so if you could also include statements telling me what you did, I would appreciate it. The entire chapter talks about array index out of bounds which has completely confused me and there are no examples in the book to help. If you could complete this program, it will help me to better understand how this works and what it is used for.

Program Problem

Design and implement the class myArray that solves the array index out of bound problem and also allows the user to begin the array index starting at any integer, positive or negative. Every object of the type myArray is an array of type int. During execution, when accessing an array component, if the index is out of bounds, the program must terminate with an appropriate error message. Consider the following statements;

myArray<int> list(5); //Line 1
myArray<int> myList(2,13); //Line 2
myArray<int> yourList(-5,9); //Line 3

The statement in line 1 declares list to be an array of 5 components, the component type is int, and the components are: list [0], list [1], ..., list [4];

The statement in line 2 declares myList to be an array of 11 components, the component type is int, and the components are;
myList[2], myList[3], ..., myList[12];

the statement in line 3 declares yourList to be an array of 14 components, the component type is int, and the componest are:
yourList[-5], yourList[-4], ..., yourList[0], ..., yourList[8].

Write a program to test the class myArray.

 

Reference no: EM13943188

Questions Cloud

When using the discounted free cash flow model : The firm's weighted average cost of capital, denoted rwacc, is the cost of capital that reflects the risk of the overall business, which is the combined risk of the firm's equity and debt. When using the discounted free cash flow model we should use ..
Performance and reward management scheme : You work for an organization operating in the built environment sector. Senior management have tasked you with producing a new performance and reward management scheme to successfully embed sustainability into the culture of the organization.
New sausage system with an installed cost : Parker is looking at a new sausage system with an installed cost of $480,000. This cost will be depreciated straight-line to zero over the project's five-year life, at the end of which the sausage system can be scrapped for $70,000. The sausage syste..
Write a program to test the class myarray. : Design and implement the class myArray that solves the array index out of bound problem and also allows the user to begin the array index starting at any integer, positive or negative
What is probability-annual return on small-company stocks : Assume that annual returns on small-company stocks are normally distributed with an average historical return of 17.1% and a standard deviation of 32.6%. What is the probability that annual return on small-company stocks is positive? Show all work.
Provide a current example of a compelling news story : After studying the assigned reading 21st Century Communication: A Reference Handbook: Chapter 65: The Changing Nature of "News" considering the concepts of timeliness, proximity, unusualness, prominence, impact, conflict and human interest, provid..
Determine pounds of quicklime and soda ash : A lime-soda softening plant treats a flow of 150 MGD, and the water has 86mg/l Ca2+, 35 mg/L Mg2+, 299 mg/L HCO3- and 6mg/l CO2. The commercial grade of quicklime has a purity of 85% and the soda ash has a purity of 95%. Determine the pounds of qu..
Many projects use a resource that the company already owns : Many projects use a resource that the company already owns. When evaluating a capital budgeting decision, we generally include interest expense. Only include as incremental expenses in your capital budgeting analysis the additional overhead expenses ..

Reviews

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

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