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

  Define function which may be present in program

One of the functions in C program is special - this is the main() function. What is so special about it? What differs main() from any other function which could be present in your program?

  Large programming team and perhaps work on multiple projects

You wonder how large programming teams be sure that they use the same naming conventions and that their programs work together even though they are created independently. You research the Internet and any resources at your disposal for information..

  Implementing the code

Write down a program which uses a structure named CorpData in order to store the following information about a company division: Involve a constructor that enables the division name and four quarterly sales amounts to be specified at the time a Cor..

  Make a windows form program for a nina''s cookie source

contain at least one other functional control such as a button (Exit button) or a MenuStrip having an Exit and an About selection.

  Give declaration and definition of a structure

Write down a program to display the initial values held by the structure (you must use a structure) on the screen.give declaration and definition of a structure.

  Software measurement and software metrics

Explain whether the software measurement is equivalent to the software metrics? What makes them different? Explain the common software metrics which you already know, heard about or used?

  Define role of customer and end-user on an agile process

Define role of customer and end-user on an agile process

  Investigating a social engineering attack

Investigate a social engineering attack describing what has made this attack more successful and the information which was observed from this attack is sure to involve how could this attack be avoided.

  Select what technologies you feel would be appropriate

select what technologies you feel would be appropriate (cost-wise and maintenance-wise) for a site's implementation.

  Make a program find that searches all files

Write a program Find out that searches all files specified on the command line and prints out all lines containing a reserved word.

  What is the itsec

What is the meaning of CIA triad in Information Security.What is the difference between Symmetric and Asymmetric Key Cryptography

  Testing program using numbers of command line arguments

Test your program thoroughly utilizing different numbers of command line arguments.

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