ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 20 May 2017 My Price 8.00

The SafeArray Project

help with this C++ Data Structure assignment. Please read the attached instructions carefully before accepting this.

 

The SafeArray ProjectRecall that there is no check on an array index out of bounds.However, during programexecution, an array index out of bounds can cause serious problems. Also, in C++, the arrayindexes starts at 0.Design and implement the templatedclass SafeArraythat solves the array index out ofbounds problem and also allows the user to begin the array indexes to start at an arbitraryindex a and end at an arbitrary index b-1, provided a < b. These integers may be negativeEvery object of this class represents an array of values of the template type.The templatedclass should be contained in a file namedSafeArray.h.That MUST be the name with nomodifications.The private section of the class declaration is as follows:int firstValid;int firstInvalid;T *A;You will use a dynamic array A to implement the SafeArray objects.Moreover, the user will beable to use indexes i withfirstValidIndex <= i < firstInvalidIndex.This means that your code for the [ ] operator will have to translate these indices to ones thatstart at 0.Consider the following statements:SafeArray<int> myArray(5);//Line 1firstValidIndex 0//firstInvalidIndex 5SafeArray<int> myMyArray(2, 13);//Line 2firstValidIndex 2//firstInvalidIndex 13SafeArray<int> yourArray(-5, 9);//Line 3 firstValidIndex -5//firstInvalidIndex 9The statement in Line 1 declareslistto be an array of 5 components, the component type isint, and the valid index references are:myArray[0], myArray[1], ..., myArray[4].The statement in Line 2 declaresmyArrayto be an array of 11 components, the componenttype isint, and the valid index references are:myMyArray[2], myMyArray[3], ..., myMyArray[12].The statement in Line 3 declaresyourArrayto be an array of 14 components, thecomponent type isint, and the valid index references are:yourArray[-5], yourArray[-4], ..., yourArray[0], ..., yourArray[8].

Attachments:

Answers

(11)
Status NEW Posted 20 May 2017 08:05 AM My Price 8.00

-----------

Attachments

file 1495270609-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)