Welcome! Log In Create A New Profile


Assignment 2

Posted by tshax 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 2
February 22, 2010 01:09PM
Has anyone started with assignment 02, I am having a hard time to make the program to run in page 163. The Qlist its confiusing me how do i link it to FIlmlist class? Anyone with ideas please assist.sad smiley
avatar Re: Assignment 2
February 23, 2010 02:51PM
I am just about to dive into it, but I dont have the page numbers to refer to = I dont want to dive into the wrong questions! confused smiley
From what I can see (and please correct me), the questions are as follows
Part A
Question 1 - 6.8 Exercises: Inheritance and Polymorphism (Seems like the same as yours, tshax)
Question 2 - Exercises: Signals and Slots (Looks like matches the requirements. Assignment mentioned SliderLCD?)
Part B
Question 1 - 6.9 Review questions. There are 9 questions, we do the first 8?
Question 2 - 9.8 Review questions. There are 15 questions, we do the first 13?
Question 3 - No confusion on source as assignment has question.
If ok, will join the adventure tomorrow?

Everything should be as simple as it is, but not simpler - Einstein
avatar Re: Assignment 2
February 25, 2010 09:58AM
Received this from our Lecturer, Ken Halland in a PDF but have attached the relevant parts here below. Note that this is for the online/PDF version of the book ONLY
Hi Greg

The exercise numbers in the online version of Ezust differ from the printed version (and the assignment questions given in Tut Letter 101 are based on the printed version). I've attached a document with the corresponding exercise numbers for the online version.

Hope this helps
Ken Halland

Extract from PDF
Question 1

Chapter 6 of Ezust: Exercise 1 in Section 6.8

Submit the code of all the classes that you write, as well as the main program to test the classes. Submit
the output of this program. Note that you should write a console application, not a GUI app.

Question 2

Chapter 9 of Ezust: Exercise 1 in Section

Submit the code of the SliderLCD class as well as the main program that shows it. Submit an image of
the application while it is running (as done in Part A of Assignment 1).

Part B

Question 1

Chapter 6 of Ezust: Review questions 1, 2, 3, 5, 6, 7, 8 and 9 in Section 6.9

Question 2

Chapter 9 of Ezust: Review questions 1, 3 to 11 and 13 to 15 in Section 9.8
Re: Assignment 2
February 26, 2010 10:50AM
You are right about the questions Gabam. Now can we start.

I managed to do a header file for the first question and am not certain about declaration of FilmList class, can someone tell me if the below code is correct ...

class FilmList: public QStringList



void toString()const;

void findFilm(QString id);

QString getID(QString title);

void addFilm(Film* film) const;

void removeFilm(QString filmID);

Re: Assignment 2
March 01, 2010 02:15PM
from the UML diagram , seems that the FilmList class should be derrived from QList and not QStringList ?

Not sure i understand what has to happen here, i think that the FilmList class should be declared as a template class, i.e

template <class Type>
class FilmList: public QList<Type>


QString toString() const;

Type* findFilm(QString id);

QString getID(QString title);

void addFilm(Type* film) ;

void removeFilm(QString filmID);


has anyone else managed to do it another way ?
any suggestions ?
avatar Re: Assignment 2
March 06, 2010 05:30PM
Hi Guys

I stumbled upon this thread while looking for something else. Let me help you guys out.

The UML diagram is correct and no templates should be used FilmList inherets from QList because you need to store the list of films in it.

Remember because Film is the base class of both the other film types, both the derived class objects can be passed to a function that has a parameter of type Film.

Thus void addFilm(Film* film) ; can take a Film, an Entertainment film or an Educational film as a parameter.

Hope that helps

Re: Assignment 2
March 12, 2010 08:06AM
Ho you guys doing with this assignment ?

I have managed to complete Question 2(SliderLCD) and Question 3 (Observer Pattern Auction) , still have a couple of questions about Question 1 smiling smiley , how did you implement the member functions of the FilmList Class , from my understanding the findfilm and getid functions need to access the private members of the Film Class (i.e. the m_filmid and the m_title) , and the only way i can think of is to either use a member accessor function on the Film class , or to make the FilmList class a friend to the Film class.

Any ideas ?
Re: Assignment 2
March 13, 2010 07:42PM
how does one add a string to a Qlist from console input?
i m struggling to ge the add item working....
Re: Assignment 2
March 18, 2010 06:04PM
I'm struggling to get the SliderLcd example to compile. I have copied the code exactly from the 2010 Disk and I have also copied the .h and .ccp files for the logWindow, but the program still refuses to compile. I keep on getting the following errors. Can anyone please help me, I can't do Question 2 of the assignment if I can't get the example to compile. the error I get is the following:

undefined reference to `LogWindow::LogWindow(QString, QWidget*)'

What must I do to remedy this problem?
Re: Assignment 2
March 18, 2010 09:33PM
Japster - On page 15 of TUT 102 - section that starts with "Copy the files....." do what it says in that section.
(3rd last paragraph on the page)

Re: Assignment 2
March 20, 2010 09:37AM
Hi There

I was enjoying doing C++ in until I came across this module.

Im also struggling with assignment 2. I have implimented FilmList class
using QStringList but the only problem is that i dont know how to add Films
into the list using AddFilm fuction, because it has a pointer of type Film as a

please help.
Anonymous User
Re: Assignment 2
March 23, 2010 01:30PM
You know I could not download the cd even from the internet. My cd did not work. I downloaded the software from the internet. would you please send me the code from the cd for the slider problem from the cd.
my email: wisemary_stephen@yahoo.com
Re: Assignment 2
March 23, 2010 05:06PM
I know how you feel 45686017, this book is the worst. Just got my physical copy, maybe I will find the subject more palatable now :-( SBTW, you should be using QList, not QStringList.
See Example 23.9 for an example on adding records to a QList. Just note that you should not be using templates as was done in the example.
Re: Assignment 2
March 25, 2010 10:35PM
You can download all the source and libs from http://cartan.cas.suffolk.edu/oopdocbook/dist/
Sorry, only registered users may post in this forum.

Click here to login