Hello, everybody. I'm stuck on an assignment I've been given recently. Looks like I've missed many lectures in programming.

Here's the thread. I'm just asking for some hints, really, I'd appreciate that.

The problem:
Write a complete program with at least one example for using all interface functions of the corresponding ADT: Implement the ObjectIterator ADT to the NodeList class and complete print function.

I also have a code fragment:

template <typename Object>
void print(NodeList<Object>& L) {			  // print a NodeList
  NodeList<Object>::ObjectIterator iter = L.elements();	  // element iterator
  while (iter.hasNext()) {				  // while more remain
    cout << iter.next() << " ";				  // print next/advance
  }
}

So what should I do about it?
Thanks!

Recommended Answers

All 5 Replies

It looks pretty good the way it is. What problems are you having with it?

What I want to know is the general idea of the task.
I must implement on my own the List, Node and Iterator class and all methods within them, is that what I'm supposed to do?
And please give me a clue about what ADT really stands for, because my idea for it is quite abstract.

Thank you very much!

I don't know what you're supposed to do, I'm not in your class. If the assignment isn't clear, ask one of your classmates, the professor, or a teaching assistant if your course has one.

As for what "ADT" stands for, I hadn't seen the acronym before either, but learn something from this: http://lmgtfy.com/?q=Iterator+ADT ... the second result looks promising.

Oh, and a lesson learned from my own college experience: doing the assigned reading and attending lectures makes it MUCH easier to understand the material and thus to complete assignments and pass exams. Good luck!

You are right about that. Reading and attending lecturesis very important, I know it. It's just that things like job with a lot of travelling turn into great obstacles. Thank you for the link. I have collected some ideas now and I am ready to start writing the assignment. If they give me an assesment, I will share my solution with you. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.