Create and implement the class myarray

Assignment Help Computer Engineering
Reference no: EM1334446

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: EM1334446

Questions Cloud

Question about human resources - strategic leadership : Where or how does one begin in making a shift to an organization focused on quality and How might the leadership model presented in Kouzes and Posner be useful in making such a shift
Define testing and debugging in terms of run time : define in your own words the difference between testing and debugging.
Managing a human services program or business : Differences Between Managing a Human Services Program or Business - What skills do you need to prepare to manage a human service program explain why. How do you prioritize these skills
Analysis on wal-mart : Wal-Mart is the largest corporation in the world, and it has obviously enjoyed tremendous success. But while many welcome its location in their communities, others do not.
Create and implement the class myarray : Please assist with following problem. I am totally lost with this so if you can 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 t..
Prepare an innovative environment in daycare or teaching : What innovation would like to implement and What type of innovation would this be
Illustrate why do economists pay more attention to national : Illustrate why do economists pay more attention to national economies than state or regional economies.
How it influence it department''s ability to maintain : be sure to address readability as a characteristic and how it will influence an IT department's ability to maintain custom software for a corporation.
Prepare a file of remedies and responsibilities : What is the city's responsibility in addressing this situation and What remedies can the courts provide and prepare a file of remedies and responsibilities.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Computer forensics investigation

As a new computer forensics investigator and as a matter of the forensics policy and procedure, you will require to understand the procedures for processing incident scene for the digital and the logical evidence.

  Back-propagation neural network

Company hires your team in order to develop the back-propagation neural network(s) for predicting next-week trend of five stocks (that is, go up, go down, or remain same).

  Explain a mitigating strategy for the risks

Briefly identify and describe a mitigating strategy for the risks.

  What are the potential benefits of management projects

What are the potential benefits of management projects. What strategies must companies follow to achieve positive results in knowledge management projects.

  How are css, dhtml and xml associated

Find out an article or a resource about CSS, DHTML or XML. Include the URL of the original article or resource and summarize it.

  Find access time for this system is how many clock cycles

imagine that a certain cache-based system experiences a cache hit rate of 98%. A cache access requires 2 clock cycles, and main-memory access requires 40 clock cycles.

  Compare the resulting postfix expression

For every postfix expression there exists a corresponding and uniquely express infix expression that evaluates to the same number. The converse is not true.

  Show the result of the calculation metric using cstr

require to create 2 textboxes with label one with input of value to be converted English using CDbl and another to display the result of the calculation metric using cstr.

  Explain networking of cis 505

Explain networking of CIS 505? 1. Network Neutrality 2. Web2.0

  Program program that converts eight (8) bit binary numbers

Write down a C++ program that converts eight (8) bit binary numbers to their decimal equivalents. The program should retrieve the binary numbers (one at a time) from a data file (use a long int for the variable that represents the binary number).

  Define the key concepts that are involved

Explain the key concepts that are involved in transaction processing. explain the concepts and provide an explanation of the commands that are involved in the transaction. Also, explain the advantages of using transaction processing in your code.

  Amazon kindle changed the number of print books

Has popularity of the Amazon Kindle changed number of print books Kindle users buy.

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