Question: Design and implement a class that uses an array to mimic the behavior of some of the methods in the ArrayList class. Include the following
Design and implement a class that uses an array to mimic the behavior of some of the methods in the ArrayList class. Include the following methods: Add(): Adds an element to the array. Clear(): Removes all elements from the array. Contains(): Determines if a specified item is in the array. IndexOf(): Returns the index of the first occurrence of the specified item. Insert(): Insert an element into the array at a specified index. Remove(): Removes the first occurrence of the specified item. RemoveAt(): Removes an element at the specified index. Reverse(): Reverses the order of the elements in the array. Note, as you review the methods above, some may need arguments sent to them. For example Add() may need the object sent that is added to the data structure. Write a program to test your implementation. Maximum credit awarded for solutions that are readable, modularized, follow proper naming and spacing conventions. AFTER YOU COMPLETE YOUR WORK, close the solution, zip it and then upload the zipped solution to Blackboard under Course Documents rightarrow Exam1. Print your source code and a sample run. Recall you print a sample run by capturing the output screen using the Alt + PrtScn keys to place the active screen in the clipboard. Once it's in the clipboard, paste the clipboard's contents into a Word document using Ctrl + V. If there is still an issue with printing your source from within Visual Studio, you can also copy the program statements into the clipboard and paste that into Word
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
