a) compile-time error: cannot instantiate a class with a pure virtual method b) okay c) okay d) okay e) okay f) okay g) compile-time error, I has type I*, e has type E*, and E is not a subtype of I h) okay i) compile-time error, C not a subclass of D j) okay, h wird zu NULL k) okay, m wird zu d l) okay m) okay n) okay) o) compile-time error, see (g) ===== template int read(List l) { int n = 0; while (true) { T x; cin >> x ; if (!cin) return -1; if (isend(x)) return n; l.append(x); n++; } } template class List { int len; ... // complexity O(n), not O(1) public void appendV1(T&x) { insert(len,x); } Node *head; Node *tail; List(): head(NULL), tail(NULL), len(0) { } // complexity O(1) public void appendV2(T&x) { Node *node = new Node(x,NULL); if (tail == NULL) head = node; else tail->next = node; tail = node; len++; } } ===== template class ArrayQueue: public BoundedQueue { T* a; int l; int n; int h; int t; public: ArrayQueue(int s): a(new T[s]), l(s), n(0), h(0), t(0) { } ~ArrayQueue() { delete a[]; } bool isempty() { return n == 0; } bool isfull() { return n == l; } void put(T& x) { // if (isfull()) resize(); a[t] = x; t = (t+1)%l; n++; } T get() { T x = a[h]; h = (h+1)%l; n--; return x; } private: void resize() { int n0 = 2*n; T* a0 = new T[n0]; for (int i = 0; i < n-h; i++) a0[i] = a[h+i]; for (int i = n-h; i < n; i++) a0[i] = a[i-(n-h)]; delete[] a; a = a0; h = 0; t = n; l = n0; } }; ================== set getArticleIds(Shop* s) { set result; list as = s->articles(); for (list::iterator it = as.begin(); it != as.end(); it++) { Article* a = *it; string id = a->getId(); result.insert(id); } return result; } ================== class Work { int t; int r; public: Work(int t0, int r0 = 0): t(t0), r(r0), { } // copy constructor automatically generated Work(const Work& w): t(w.t), r(w.r) { } void add(int t0) { t += t0; } void printSalary() { int s = t*r; cout << (s/100) + "," + (s%100); } bool subtract(int t0) { if (t < t0) return false; t -= t0; return true; } static void reset(Work& w) { w.t = 0; } int compare(const Work& v) { int s = t*r; int s0 = v.t*v.r; if (s == s0) return 0; if (s < s0) return 1; return -1; } };