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

  Using a lock guarantees that deadlock cannot occur

Once a Lock has been obtained by a thread, the Lock object will not allow another thread to obtain lock until the first thread releases it.

  The processor save in fraction of its visits to keyboard

In an 8-hour interval, an operator controls systems with 60 commands on an average, entered through a keyboard.

  What is meant by tcp show

Read the research literature to learn what is meant by TCP friendly. Also read the Sally Floyd interview at the end of this chapter. Write a explaining of TCP friendliness.

  Ssl protection

Explain whether pages are served over the SSL protected from problem you explained. If so, explain why; if not, explain why not.

  State diagram for coffee machine controller

Raw behavioural specs utilizing the state diagram for the coffee machine controller explained as follow. State events, State actions.

  Write down c function that includes the following sequences

Run program and explain the results. Rewrite same code in C++ and Java.

  Write c program ''myls'' that functions like unix command ''ls''

Write C program 'myls' that functions like unix command 'ls'.

  Explain networking of cis 505

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

  Describe a wireless network card

Describe a wireless network card

  Develop a checkout lane simulation

Develop a checkout lane simulation that can be used to determine the optimal number of lanes that Cougar Mart should have open.

  Make function that outputs the elements stored in the tree

Write down a program containing a function that outputs the elements stored in the tree (integers) to the screen. The integers have to be output level by level in the order they appear in the tree.

  Find out whether the list is empty

Write down the functions (in C++) to perform these basic operations on Linked List.

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