I'll start any posts I make the same way, just so people know that I'm NOT trying to get homework done...
Before I begin, let me start by saying that this is NOT homework. I am also not enrolled in a C++ class. I am simply trying to learn C++ as I have time. I am using random assigments/tutorials/whatever I can find on the net and shopping amazon for books. I'm not trying to become an awesome programmer, just trying to get a grasp on basic concepts (I'm a network admin and work with a bunch of programmers and just want to be able to understand things better)
A co worker of mine is a recent grad and took C++ a couple years ago and still had some of his old assignments I could look at but no longer had the code. I've worked several of the other problems he gave me the other day, but don't really even understand how to begin with this one..
Could someone take a look at this and either show me how this code would work or show me the code with a couple of things left out that I would need to fill in to make the code work?
Here's what he gave me:
Your are to implement a 'List' class to handle a list with general operations. That means you can insert and delete any element anywhere in the list. The list has no order, except for the order you insert or delete. The methods you are to implement are as given:
Constructor methods (two, default and copy constructor, a list to a newly defined list, ie 'List listA(listB)' )
empty returns true or false if list is empty or not.
first positions you at the beginning of the list
last positions you at the end of a list.
prev places you at the next element in the list
next places you at the previous element in the list
getPos returns where you are in the list
setPos(int) places you in a certian position in the list
<< output method to print out the list.
insertBefore insert a new element before the current position
insertAfter insert a new element after the current position
getElement returns the one element that pos is pointing to
You are to implement the List class using an array. For now the array can be 20 in size.
You will need to use the 'ElementType' for typing your data.
You will need to use CAPACITY constant for the size of the array.
Thanks in advance. I'm going to try not to post here very frequently, but my last post and this post have been things that I have had trouble with. I'm really trying to get this all on my own, but it seems like I'll need some guidance with some of this. I'm sorry to bother people with what are probably really simple programs, but I'd rather not bother my coworkers with things like this as the only time I'm around any of them is at work.