The instructions and starting templates for the assignment are attached to this module. Please download them and follow the instructions. You should submit your completed .cpp source files to this MyLeoOnline folder by the due date once you are done with the assignment.
There are actually 3 source files/starting templates for this assignment: assg-07.cpp, ListType.hpp and ListType.cpp. You need to download and use all 3. assg-07.cpp contains the main function and has tests of your code. You should not need to add anything to this file, simply uncomment the tests as you are working on your assignment. You should add your name and information to the file header at the top of all 3 files. The files ListType.hpp and ListType.cpp are the header file and implementation file respectively. You will need to add the function prototypes to the .hpp header file class definitions for the functions you are to write for this assignment. And likewise, you will need to write and implement your functions for this assignment in the .cpp file.
Assg 0
7
: Templates and Operator Overloading
COSC
2
3
3
6
Spring 20
1
9
Dates:
Due: Thursday March 07, by Midnight (note the di�erent due date)
Objectives
� Practice creating a more realistic abstract data type ADT
� Using operator overloading to do output, insertion and access into a
list.
� Use templates so our ADT can hold objects of any type
Description
In this assignment you will be practicing operator overloading. I will also,
for extra credit, give an additional task to convert your class into a class
template, so that it will work as a container for any type.
In this assignment you will be expanding on / creating a new version of
the ListType data type we have seen examples of before in class. Your task is
to create a ListType that holds a list of integers. You will be asked to create
several member functions, and then to create several overloaded operators
for your list of integers. Your basic task is to user operator overloading to
support appending and prepending to a list, outputting the list as a string
and to an output stream, accessing the list (using the indexing operator[]),
and concatenating lists together (using operator+).
I have given you a starting template for your ListType that already
contains 3 versions of the class constructor. I have also already provided you
the operator= implementation, to provide the copy operator for your class.
You should �rst get your class to work as a simple ListType that holds a
list of integers. If you get your class working for integers and submit it, you
1
can then turn your class into a template class, so that your list can work on
objects of any type. I will give up to
10
bonus points for implementations of
working class templates, if you �rst mostly have your basic ListType working
for simple integers. As usual I have also given a �le with a main function
and a lot of commented out tests. You should implement the class member
functions in the order speci�ed next, commenting out each test one at a time,
to incrementally develop and test your ListType class implementation.
For this assignment you need to perform the following tasks.
1. As mentioned in the starting template I have given you a starting class
de�nition, some class constructors and the destructor, and the copy
operator=. You �rst need to write two simple getter methods in order
to access the size and allocSize class member values. These should be
called getSize() and getAllocSize() respectively. These functions
should be class const functions (you guarantee that calling them will
not cause the class to be modi�ed. These functions take no parameters
as input. They both return an int value, because the size and allocSize
member parameters are both integer values.
2. Write a function called tostring(). This function will be a const class
function (the class is not modi�ed when it is called). This function
takes no parameters as input, and it returns a string. We use this
function in our testing, so you need to get it correct, but you have
implemented versions of this type of function in previous assignments.
The function should only create a string of the items currently in the
list. So it will return a string like “[3,
5
,
4
, 2]” if those are the 4 items
currently in the list. See the test code for speci�cs.
3. Overload the operator<<() to provide the ability for the ListType class to be output to a stream. This will be a friend function, and again it will be pretty similar to several examples we have seen of overloading the output stream operator. You should use the tostring() method in this function, but it outputs additional information, such as the id, size and allocSize of the list to the output stream.
4. Create a function named appendItem(). This function takes an int
value as its only parameter, and it does not return a value. The indi-
cated integer value should be appended to the end of your list when
this function is called. You need to correctly handle causing the size of
your memory allocation to grow if needed in this function, if your list
is currently using all of the allocated memory. Once this is working,
2
overload the operator&() operator. We will de�ne the & operator to
mean list appending. For example, if you do list & 5 it will cause 5
to be appended to the end of the list (assuming list is a variable of List-
Type). This function will simply call appendItem() to do the work,
the only di�culty is getting the syntax correct to declare you are over-
loading the operator. This is not a friend function, like operator<<().
Read our textbook about binary operators to see examples of how to
overload a binary operator like this as a member function of a class.
5. Create a function name prependItem(). This works the same as the
append, but it prepends the indicated integer parameter to the front
of the list instead of to the end. However, you still need to check and
grow your allocated memory before prepending if your list is currently
full. Also prepend is a bit more complicated, because since we are
implementing an array based list, you need to shift all of the current
items 1 index up in your items before you can prepend to the beginning
of the list. We will also overload the operator|() for our class to
represent prepending an item. Thus if you do list | 5 this will cause
5 to be prepended to the beginning of the list.
6. Overload the operator+() to implement concatenation of two lists.
This operator is probably the trickiest I have given you to implement.
This operator should take a const reference to another ListType as
its parameter for input. This is the list on the right hand side of
the + operation. This function should return a reference to a new
ListType as its result. It is important that both the input parameter
and the return type be both reference parameters for this function.
This function should be a const function, as it does not cause the
original list to change. Instead you should dynamically allocate a new
ListType in this function, �ll it with the items from the two lists being
concatenated, and then return it as the result from this overloaded
function. You should read our textbook example of overloading the
operator+() and try and follow that pattern for implementing this
function.
7. Overload the operator[] indexing operator. This is NOT a const
member function, your list can change as a result of calling this func-
tion. This function takes an int value as its input parameter. This
function should return an int& reference. Again it is very important
that this overloaded operator return a reference. If this operator cor-
rectly returns an int&, it can actually be used as a setter to set/change
3
the values in the list. This operator works to index your ListType like
an array. You should perform bounds checking in this function. If the
given input index is not valid (it is bigger than the end of your list, or
it is < 0), you should display an error message and simply exit.
If you get all of these 7 steps and member functions mostly working, you
should save/submit your work at that point. However, I am also o�ering
the opportunity to earn 10 bonus points on this assignment, which may be
helpful for many of you to make up for some previous program grades. As
demonstrated in our video for this week, it is usually better if you want
to create a class template to start from a non-template working version of
the class. As I showed in the video this week, I usually templatize each
member function 1 at a time, starting with the class de�nition and the class
constructors. I will give up to 10 bonus points for a partial or complete
templatized ListType that supports appending, prepending, indexing, and
output to streams using the overloaded operators, but for any type, not just
the int type.
You will again be given 3 starting template �les as usual, an assg-07.cpp
�le of tests of your code, and a ListType.hpp and ListType.cpp header and
implementation �le. As before, you should practice incremental develop-
ment, and uncomment the tests in the assg-07.cpp �le one at a time, and
implement the functions in the order speci�ed. If you implement your code
correctly and uncomment all of the tests, you should get the following correct
output:
——— Test constructors and getters ————————-
l1 size: 0 allocSize: 0
l2 size: 0 allocSize: 7
l3 size: 5 allocSize: 5
——— Test output stream operator —————————
l2 items: []
ListType
size = 0
allocSize = 7
items : []
l3 items: [3, 9, 2, 7, 5]
4
ListType
size = 5
allocSize = 5
items : [3, 9, 2, 7, 5]
——— Test append and operator& —————————–
append to empty l1:
ListType
size = 1
allocSize = 10
items : [1]
append to nonempty l3:
ListType
size = 6
allocSize = 15
items : [3, 9, 2, 7, 5, 12]
operator& test l3:
ListType
size =
8
allocSize = 15
items : [3, 9, 2, 7, 5, 12, 6, 11]
mixing append and operator& l1:
ListType
size = 5
allocSize = 10
items : [1, 4, 3, 7, 0]
——— Test prepend and operator| —————————-
prepend to empty l2:
ListType
5
size = 1
allocSize = 7
items : [8]
prepend to nonempty l3:
ListType
size = 9
allocSize = 15
items : [8, 3, 9, 2, 7, 5, 12, 6, 11]
operator| test l3:
ListType
size = 11
allocSize = 15
items : [4, 13, 8, 3, 9, 2, 7, 5, 12, 6, 11]
mixing prepend and append and operators l2:
ListType
size = 8
allocSize = 17
items : [4, 0, 13, 5, 7, 8, 11, 9]
——— Test concatenation operator —————————-
Test basic append, new l4:
ListType
size = 19
allocSize = 19
items : [4, 0, 13, 5, 7, 8, 11, 9, 4, 13, 8, 3, 9, 2, 7, 5, 12, 6, 11]
Test basic append, new l5:
ListType
size = 24
allocSize = 24
items : [1, 4, 3, 7, 0, 4, 13, 8, 3, 9, 2, 7, 5, 12, 6, 11, 4, 0, 13, 5, 7, 8, 11, 9]
Test concatentate emptyList, new l6:
ListType
6
size = 8
allocSize = 8
items : [4, 0, 13, 5, 7, 8, 11, 9]
Test concatentate emptyList, new l7:
ListType
size = 5
allocSize = 5
items : [1, 4, 3, 7, 0]
——— Test operator[] indexing ——————————
l1[0] == 1
l1[2] == 3
l1[4] == 0
Iterate over l2:
ListType
size = 8
allocSize = 17
items : [4, 0, 13, 5, 7, 8, 11, 9]
l2[0] == 4
l2[1] == 0
l2[2] == 13
l2[3] == 5
l2[4] == 7
l2[5] == 8
l2[6] == 11
l2[7] == 9
ListType setter using operator[] l2[0] == 8
ListType setter using operator[] l2[4] == -7
ListType setter using operator[] l2[7] == 42
——— main exiting scope, destructors should be invoked —–
ListType:
ListType:
ListType:
7
ListType:
ListType:
ListType:
ListType:
ListType:
If you templatize your ListType class, submit this in the second submis-
sion folder. You should add tests to try out your list with things other than
ints, like double and string lists.
Assignment Submission
A MyLeoOnline submission folder has been created for this assignment. You
should attach and upload your completed .cpp source �les to the submission
folder to complete this assignment. You really do not need to give me the
assg-07.cpp �le again, as I will have my own �le with additional tests of
your functions. However, please leave the names of the other two �les as
QuickSort.hpp and QuickSort.cpp when you submit them.
Requirements and Grading Rubrics
Program Execution, Output and Functional Requirements
1. Your program must compile, run and produce some sort of output to
be graded. 0 if not satis�ed.
2. (5 pts.) The getter methods getSize() and getAllocSize() are im-
plemented and working.
3. (10 pts.) tostring() works and only creates a string with the items
of the list and returns it. opeator<<() works, displays the additional
information on the output stream, and uses tostring() in its imple-
mentation.
4. (15 pts.) Got list appending working correctly. The appendItem()
member function is implemented correctly, and the operator&() is
overloaded as a member function, and it uses appendItem() to do the
actual work of appending. Memory is grown if needed by this function.
5. (15 pts.) Go list prepending working correctly. The prependItem()
member function is implemented correctly, and the operator|() is
8
overloaded as a member function, and it uses prependItem() to do
the actual work of prepending. Items are shifted up which is necessary
in the array implemented for prepending. Memory is correctly grown
if needed by this function.
6. (25 pts) operator+() is correctly overloaded. The operator correctly
supports concatentation of two lists. The operator is de�ned as a class
const method. The operator correctly dynamically allocates a new
list and puts the items of the two lists into it, and returns this newly
allocated object as its result. A reference to the other list is given as
input, and this function returns a refereunce to a list as the result.
7. (20 pts) operator[] is correctly overloaded. The operator returns an
int reference as its result. The operator correctly checks for bounds
access errors, for indexes to big or less than 0. The operator correctly
works as a setter method, so that values can be modi�ed/assigned in
the list.
8. (5 pts.) All output is correct and matches the correct example output.
9. (5 pts.) Followed class style guidelines, especially those mentioned
below.
10. (10 bonus pts.) You may templatize your class and submit it (complete
or partial) for up to 10 bonus points. Your templatized class must
support all of the overloaded operations (append, prepend, indexing,
output stream), and work with any class, like string, double, etc.
Program Style
Your programs must conform to the style and formatting guidelines given
for this class. The following is a list of the guidelines that are required for
the assignment to be submitted this week.
1. Most importantly, make sure you �gure out how to set your indentation
settings correctly. All programs must use 2 spaces for all indentation
levels, and all indentation levels must be correctly indented. Also all
tabs must be removed from �les, and only 2 spaces used for indentation.
2. A function header must be present for member functions you de�ne.
You must give a short description of the function, and document all of
the input parameters to the function, as well as the return value and
9
data type of the function if it returns a value for the member functions,
just like for regular functions. However, setter and getter methods do
not require function headers.
3. You should have a document header for your class. The class header
document should give a description of the class. Also you should doc-
ument all private member variables that the class manages in the class
document header.
4. Do not include any statements (such as system(“pause”) or inputting
a key from the user to continue) that are meant to keep the terminal
from going away. Do not include any code that is speci�c to a single
operating system, such as the system(“pause”) which is Microsoft
Windows speci�c.
10
/**
* @author Jane Programmer
* @cwid 123 45 678
* @class COSC 2336, Spring 2019
* @ide Visual Studio Community 2017
* @date February 15, 2019
* @assg Assignment 07 Operator Overloading
*
* @description Assignment 07 part 01, practice with operator overloading.
* In this first part of assignment, you need to define a ListType class
* and overload the indicated operators. This version of your class
* will only support list of int values. You will turn this into a
* class template in part 2 of the assignment.
*/
#include
#include
using namespace std;
#ifndef _LISTTYPE_H_
#define _LISTTYPE_H_
/** ListType abstract data type
* This list type is “templatized” to support creating concrete lists of
* any type of object. This list supports dynamic shrinking and growing
* of its size as items are appended and removed from the list.
* In addition, several operators are overloaded for convenience of
* inserting, accessing and outputting the list to a stream.
*
* @value id A unique id, each list is assigned its own unique id
* upon creation.
* @value size The current size (an int) or number of items currently
* contained in the list.
* @value allocSize The actual amount of memory we currently
* have allocated.
* @value item A (pointer to an) array of items of our templated
*
*/
class ListType
{
private:
// initial allocSize, unless overridden in construction
const int ALLOCATION_INCREMENT = 10;
static int nextListId; // class variable, assign unique listid
int id;
int size;
int allocSize;
int* item;
public:
ListType(); // default constructor
ListType(int allocSize); // empty constructor
ListType(int size, int* items); // construct from array
~ListType(); // class destructor
// getters
// member functions
// overloaded operators
const ListType& operator=(const ListType& rightList); // I also gave you the copy operator
};
// need to include the template implementations here, if/when you templatize
//#include “ListType.cpp”
#endif // _LISTTYPE_H_
/**
* @author Jane Programmer
* @cwid 123 45 678
* @class COSC 2336, Spring 2019
* @ide Visual Studio Community 2017
* @date February 15, 2019
* @assg Assignment 07 Operator Overloading
*
* @description Assignment 07 part 01, practice with operator overloading.
* In this first part of assignment, you need to define a ListType class
* and overload the indicated operators. This version of your class
* will only support list of int values. You will turn this into a
* class template in part 2 of the assignment.
*/
#include “ListType.hpp”
// static member variables have to be initialized like this
int ListType::nextListId = 1;
/** default constructor
* Initialize as an empty list. Initially we have no memory
* allocated, and the size (and allocation size) are 0.
*/
ListType::ListType()
{
id = nextListId++;
size = allocSize = 0;
item = NULL;
}
/** constructor (empty)
* Initialize as an empty list with indicated iniaial
* size of memory allocated.
*
* @param allocSize The initialze size for the empty list.
*/
ListType::ListType(int allocSize)
{
id = nextListId++;
size = 0;
this->allocSize = allocSize;
item = new int[this->allocSize];
}
/** constructor (array)
* Initialize a list using an array of items for the initial values
* in the list.
*
* @param size The number of items in the array given for initialization.
* @param items An array (pointer to base address) of items to initialize
* this list with.
*/
ListType::ListType(int size, int* initItem)
{
id = nextListId++;
this->size = size;
this->allocSize = size;
item = new int[this->size];
// copy the items into this list
for (int index = 0; index < this->size; index++)
{
item[index] = initItem[index];
}
}
/** destructor
* The class destructor. Be good stewards of memory and make
* sure that we free up memory allocated to hold our list items
* by this object when it goes out of scope. We display some
* information for debugging/tracking ListType destruction.
*/
ListType::~ListType()
{
cout << "ListType:
<< size
<< " allocSize: " << allocSize << endl;
// be a good memory manager, free up memory we have allocated
if (item != NULL)
{
delete [] item;
}
}
/** overload operator=
* Overload the operator= assignment operator. Whenever one list
* variable is assigned to another this operator is invoked.
*
* @param rhs The list on the right hand side of the assignment, the
* contents of which is to be (deep) copied to this list contents.
*
* @returns ListType Returns a reference to this list, after contents
* have been copied/assigned.
*/
const ListType& ListType::operator=(const ListType& rhs)
{
// only assign if not doing a self-assignment
if (this != &rhs)
{
// copy the values from rightList into this list
int newAllocSize = rhs.size;
// if not enough space, grow our list
if (this->allocSize < newAllocSize)
{
int* newItem = new int[newAllocSize];
delete [] item;
item = newItem;
this->allocSize = newAllocSize;
}
// copy the items from righ hand side into this list
for (int index = 0; index < rhs.size; index++)
{
this->item[index] = rhs.item[index];
}
this->size = rhs.size;
}
// return the object assigned
return *this;
}
/**
* @author Jane Programmer
* @cwid 123 45 678
* @class COSC 2336, Spring 2019
* @ide Visual Studio Community 2017
* @date February 15, 2019
* @assg Assignment 07 Templates and Operator Overloading
*
* @description Assignment 07 part 01, practice with operator overloading.
* In this first part of assignment, you need to define a ListType class
* and overload the indicated operators. This version of your class
* will only support list of int values. You will turn this into a
* class template in part 2 of the assignment.
*/
#include
#include
#include
#include “ListType.hpp”
using namespace std;
/** main
* The main entry point for this program. Execution of this program
* will begin with this main function.
*
* @param argc The command line argument count which is the number of
* command line arguments provided by user when they started
* the program.
* @param argv The command line arguments, an array of character
* arrays.
*
* @returns An int value indicating program exit status. Usually 0
* is returned to indicate normal exit and a non-zero value
* is returned to indicate an error condition.
*/
int main(int argc, char** argv)
{
//————————————————————————
// test constructors and getters
cout << "--------- Test constructors and getters -------------------------" << endl;
ListType l1;
//cout << "l1 size: " << l1.getSize()
// << " allocSize: " << l1.getAllocSize() << endl;
//assert(l1.getSize() == 0);
//assert(l1.getAllocSize() == 0);
ListType l2(7); // empty list but with room for 7 items
//cout << "l2 size: " << l2.getSize()
// << " allocSize: " << l2.getAllocSize() << endl;
//assert(l2.getSize() == 0);
//assert(l2.getAllocSize() == 7);
int size = 5;
int items[] = {3, 9, 2, 7, 5};
ListType l3(size, items);
//cout << "l3 size: " << l3.getSize()
// << " allocSize: " << l3.getAllocSize() << endl;
//assert(l3.getSize() == 5);
//assert(l3.getAllocSize() == 5);
cout << endl << endl;
//------------------------------------------------------------------------
// test output stream operator implementation
cout << "--------- Test output stream operator ---------------------------" << endl;
//cout << "l2 items: " << l2.tostring() << endl;
//assert(l2.tostring() == "[]");
//cout << l2 << endl << endl;
//cout << "l3 items: " << l3.tostring() << endl;
//assert(l3.tostring() == "[3, 9, 2, 7, 5]");
//cout << l3 << endl << endl;
cout << endl << endl;
//------------------------------------------------------------------------
// test appending and operator& overloading
cout << "--------- Test append and operator& -----------------------------" << endl;
// append to empty list
//l1.appendItem(1);
//cout << "append to empty l1: " << endl << l1 << endl;
//assert(l1.tostring() == "[1]" );
//assert(l1.getSize() == 1);
//assert(l1.getAllocSize() == 10);
// append to non empty list
//l3.appendItem(12);
//cout << "append to nonempty l3: " << endl << l3 << endl;
//assert(l3.tostring() == "[3, 9, 2, 7, 5, 12]" );
//assert(l3.getSize() == 6);
//assert(l3.getAllocSize() == 15);
// append 2 items using operator& and test
//l3 & 6;
//l3 & 11;
//cout << "operator& test l3: " << endl << l3 << endl;
//assert(l3.tostring() == "[3, 9, 2, 7, 5, 12, 6, 11]" );
//assert(l3.getSize() == 8);
//assert(l3.getAllocSize() == 15);
// some more, mix up append function and operator
//l1.appendItem(4);
//l1 & 3;
//l1 & 7;
//l1.appendItem(0);
//cout << "mixing append and operator& l1: " << endl << l1 << endl;
//assert(l1.tostring() == "[1, 4, 3, 7, 0]");
//assert(l1.getSize() == 5);
//assert(l1.getAllocSize() == 10);
cout << endl << endl;
//------------------------------------------------------------------------
// test prepending operator| overloading
cout << "--------- Test prepend and operator| ----------------------------" << endl;
// prepend to empty list
//l2.prependItem(8);
//cout << "prepend to empty l2: " << endl << l2 << endl;
//assert(l2.tostring() == "[8]" );
//assert(l2.getSize() == 1);
//assert(l2.getAllocSize() == 7);
// prepend to nonempty list
//l3.prependItem(8);
//cout << "prepend to nonempty l3: " << endl << l3 << endl;
//assert(l3.tostring() == "[8, 3, 9, 2, 7, 5, 12, 6, 11]" );
//assert(l3.getSize() == 9);
//assert(l3.getAllocSize() == 15);
// operator| test
//l3 | 13;
//l3 | 4;
//cout << "operator| test l3: " << endl << l3 << endl;
//assert(l3.tostring() == "[4, 13, 8, 3, 9, 2, 7, 5, 12, 6, 11]");
//assert(l3.getSize() == 11);
//assert(l3.getAllocSize() == 15);
// some more, mix up prepend function and operator
//l2.prependItem(7);
//l2 & 11;
//l2 | 5;
//l2.appendItem(9);
//l2 | 13;
//l2 | 0;
//l2 | 4;
//cout << "mixing prepend and append and operators l2: " << endl << l2 << endl;
//assert(l2.tostring() == "[4, 0, 13, 5, 7, 8, 11, 9]");
//assert(l2.getSize() == 8);
//assert(l2.getAllocSize() == 17);
cout << endl << endl;
//------------------------------------------------------------------------
// test concatenation
cout << "--------- Test concatenation operator ----------------------------" << endl;
//ListType l4 = l2 + l3;
//cout << "Test basic append, new l4: " << endl << l4 << endl;
//assert(l4.tostring() == "[4, 0, 13, 5, 7, 8, 11, 9, 4, 13, 8, 3, 9, 2, 7, 5, 12, 6, 11]");
//assert(l4.getSize() == 19);
//assert(l4.getAllocSize() == 19);
//ListType l5 = l1 + l3 + l2;
//cout << "Test basic append, new l5: " << endl << l5 << endl;
//assert(l5.tostring() == "[1, 4, 3, 7, 0, 4, 13, 8, 3, 9, 2, 7, 5, 12, 6, 11, 4, 0, 13, 5, 7, 8, 11, 9]");
//assert(l5.getSize() == 24);
//assert(l5.getAllocSize() == 24);
//ListType emptyList;
//ListType l6 = l2 + emptyList;
//cout << "Test concatentate emptyList, new l6: " << endl << l6 << endl;
//assert(l6.tostring() == l2.tostring());
//assert(l6.getSize() == 8);
//assert(l6.getAllocSize() == 8);
//ListType l7 = emptyList + l1;
//cout << "Test concatentate emptyList, new l7: " << endl << l7 << endl;
//assert(l7.tostring() == l1.tostring());
//assert(l7.getSize() == 5);
//assert(l7.getAllocSize() == 5);
cout << endl << endl;
//------------------------------------------------------------------------
// test operator[] indexing and setter
cout << "--------- Test operator[] indexing ------------------------------" << endl;
//cout << "l1[0] == " << l1[0] << endl;
//assert(l1[0] == 1);
//cout << "l1[2] == " << l1[2] << endl;
//assert(l1[2] == 3);
//cout << "l1[4] == " << l1[4] << endl;
//assert(l1[4] == 0);
//cout << "Iterate over l2:" << endl << l2 << endl;
//for (int index = 0; index < l2.getSize(); index++)
//{
// cout << " l2[" << index << "] == " << l2[index] << endl;
//}
//cout << endl;
//l2[0] = 8;
//cout << "ListType setter using operator[] l2[0] == " << l2[0] << endl;
//assert(l2[0] == 8);
//l2[4] = -7;
//cout << "ListType setter using operator[] l2[4] == " << l2[4] << endl;
//assert(l2[4] == -7);
//l2[7] = 42;
//cout << "ListType setter using operator[] l2[7] == " << l2[7] << endl;
//assert(l2[7] == 42);
// test bounds checking on operator[]
// you should uncomment these to test, but you shouldn't leave them uncommented
// should cause exit and error message
//cout << l2[-5];
// should cause exit and error message
//cout << l2[8];
cout << endl << endl;
//------------------------------------------------------------------------
// test out of scope, destructors should be called
cout << "--------- main exiting scope, destructors should be invoked -----" << endl;
// return 0 to indicate successful completion
return 0;
}
We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.
Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.
Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.
Your deadline is our threshold for success and we take it very seriously. We make sure you receive your papers before your predefined time.
Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.
Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.
We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.
Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.
You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.
Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.
Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.
From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.
Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.
Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.
You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.
You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.
Join us for the best experience while seeking writing assistance in your college life. A good grade is all you need to boost up your academic excellence and we are all about it.
We create perfect papers according to the guidelines.
We seamlessly edit out errors from your papers.
We thoroughly read your final draft to identify errors.
Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!
Dedication. Quality. Commitment. Punctuality
Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.
We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.
We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.
We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.
We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.