ArrayList template C++


Attached the files needed.

You'll need to do five things to satisfy this project's requirements:

1- Rewrite the given ArrayList class as a class template ArrayList<T>. It should take a single type parameter that specifies what kind of elements are stored in the array-based

list (e.g., an ArrayList<int> has integer elements, while an ArrayList<std::string> contains strings instead). Your new ArrayList<T> class template should completely replace the existing class (i.e., only turn in an ArrayList<T> class template, and do not change its name to something else), and it must be written in a file named [url removed, login to view] (i.e., replacing the files that were provided).

2- Rewrite the at() member functions so that they throw an exception when an out-of-bounds index is passed to them (e.g., someone asks for the element at index 5 when the ArrayList contains only 3 elements). Write a new class to represent this exception, though it doesn't need to contain any member variables or member functions.

3- Rewrite any other member functions so that the ArrayList is left in a valid state and memory does not leak if exceptions are thrown. (The most important one to pay attention to is the exception std::bad_alloc, which is thrown by the new operator when there is not enough memory to allocate what's been asked for.) Note that this doesn't mean the member functions shouldn't throw exceptions; it just means that when they do, the ArrayList is in a valid state and memory isn't leaked.

4- Write a short program — this project's app — that asks a user to type ten student IDs and names to the program's standard input (i.e., std::cin), one per line in the following format (i.e., the student ID as an integer, followed by a space, followed by the student's name):

123 Boo Thornton

4444 Joe D. Student

88 Alex Thornton


then prints the same data in a different format as follows:

Boo Thornton (ID#123)

Joe D. Student (ID#4444)

Alex Thornton (ID#88)

Use your ArrayList<T> class template to store the information while reading the input, then iterate through it to print the information back out. Feel free to assume that the input will be in the format specified; it doesn't matter what your program does if it isn't.

5- Using Google Test, write a suite of unit tests to verify that your newly-written ArrayList class template is complete and correct.

Compiling and running your project

Your ArrayList<T> implementation should be written in the core directory inside your project directory. The meager user interface can be written in a main() function in the app directory. Write your unit tests in the gtest directory, and feel free to write any experiments in the exp directory (experiments are not required).

When you're ready to compile it, change into the directory ~/projects/proj0 (if you're not already there) and issue the command ./build. (Note the dot and the slash in front of the word "build" — those are important! — and remember that you can tell that script what to build if you only want to build one thing, like app.) If compiling is successful, then issue the command ./run app to run your program, ./run gtest to run your unit tests, or ./run exp to run your experiments.

Also, if you want to check for misuse of memory, you can use the --memcheck option when you use the run script (e.g., ./run --memcheck app), which uses a tool called Valgrind to monitor memory usage.

How to solve the problem

Feel free to use the <iostream> and <string> headers in the C++ Standard Library, but don't use existing containers such as std::vector, since the goal here is to give your new ArrayList<T> class template a workout. Also, avoid smart pointers like std::unique_ptr or std::shared_ptr

Evner: C++ Programmering

Se mere: software write mq4, software write chip epson, useful software write book, software write web specs, free software write user guide, software write edid, free software write company profile, software write websites idea, software write book images, software write books, software write protection, free software write book, selenium php test suite, php selenium test suite, software write book, test suite selenium, create html test suite report selenium, creating selenium test suite, selenium test test suite, create selenium test suite

Om arbejdsgiveren:
( 28 bedømmelser ) gardena, United States

Projekt ID: #14581750

Tildelt til:


I can help you with this ArrayList<T> template as I have developed Linked Lists, Vectors, Queues, Stacks, and etc. in C++ on this website. I will deliver everything within 24 hours. Relevant Skills and Experience I Flere

$35 USD på 1 dag
(37 bedømmelser)

13 freelancere byder i gennemsnit $32 på dette job

$25 USD på 1 dag
(66 bedømmelser)

Hello there, lots of experience teaching algorithms and data structures with C/C++. I can provide the solutions specified from points 1 to 5 (is it safe to assume that you take care of the "Compiling and running your p Flere

$35 USD på 1 dag
(26 bedømmelser)
$30 USD på 1 dag
(14 bedømmelser)

Hi, sir I have a detail look to your project, I have a great skill in c++. I'm sure I can complete your project. My price and period is negotiable. We can discuss the details via chat. Thanks. Relevant Skills and Expe Flere

$35 USD in 0 dage
(23 bedømmelser)

Hi , I can do this within 24h. Check out my profile and let me know if you're interested. Thanks, Dhananjoy [login to view URL] Relevant Skills and Experience C++14 Proposed Milestones $40 USD - Full Flere

$40 USD på 1 dag
(7 bedømmelser)

Feel fee to contact me [login to view URL] me message to discuss further more details .We provide the comments,images,videos,demos and live sessions in order to help the [login to view URL] payment only after the work [login to view URL] yo Flere

$30 USD på 1 dag
(7 bedømmelser)
$15 USD på 1 dag
(6 bedømmelser)
$55 USD på 1 dag
(6 bedømmelser)

Please look at amazing discount on website development-- [login to view URL] Greetings, we are a team of 35 developers and 20 designers and each having more than 8 years experience. I would very much happy to wo Flere

$25 USD på 1 dag
(0 bedømmelser)

i can do it Relevant Skills and Experience good 2 yrs exp Proposed Milestones $33 USD - neg.

$33 USD på 1 dag
(0 bedømmelser)

Hi, I am interested in your project and I would like to discuss. Relevant Skills and Experience C, C++, Linux, Programming, Proposed Milestones $29 USD - Open

$29 USD på 1 dag
(0 bedømmelser)
$35 USD på 1 dag
(0 bedømmelser)