Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The supplied code is below this image. The language is C++ 1. Download the supplied code. Do not change anything in the supplied code which

The "supplied code" is below this image. The language is C++

image text in transcribed

image text in transcribed

1. Download the supplied code. Do not change anything in the supplied code which is the Ch13_Ex11_MainProgram.cpp (except to add documentation and your name). Please use the file names listed below since your file will have the same components in the supplied code. AMMENDMENT TO DOCUMENT....CHANGE TO: list3[-2] = 7; list3[4] = 8; list[e] = 54; list3[2] = list3[4] + list3[-2]; //THIS WILL HELP MATCH THE SCREEN CAPTURE BELOW 2. Recall that in C++, there is no check on an array index out of bounds. However, during program execution, an array index out of bounds can cause serious problems. Also, in C++, the array index starts at 0. 3. Design and implement the class myArray that solves the array index out of bounds problem and also allows the user to begin the array index starting at any integer, positive or negative. Every object of 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 list(5); //Line 1 myArray myList(2, 13); //Line 2 myArray 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 components are: yourList[-5), yourlist[-4], ..., yourList[0], ..., yourList[8]. listi : @@@@@ Enter 5 integers: 9 8 7 After filling listi: 9 8 7 5 6 list2 : 98 % 5 6 Enter 3 elements: 1 3 First three elements of listi: 1 2 3 list3: @@@@@@@@ list3: 7 7 54 15 8g Press any key to continue ... 4. Write a program to test the class myArray. 5. ZIP and submit the entire project folder with * sin project file inside and submit to the Assignment Folder. V/ Ch13_Ex11_Main Program.cpp - given code below // #include "stdafxib" may uncomment this if Visual Studios requires #include #include "xArcaxab" using namespace std; int main() cout > listi[i]; cout > listi[i]; sout #include "xArcaxab" using namespace std; int main() cout > listi[i]; cout > listi[i]; sout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago