Welcome! Log In Create A New Profile

Advanced

Exam 2008 Question 5

Posted by PretoriaSux 
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
avatar Exam 2008 Question 5
November 15, 2009 06:19PM
Guys for question 5 I would like to know is it correct to assume the following:

Language: C++ (QT)
class DVD:public QObject { ... public DVD(QString anID, QString aTitle, QString aPrice); ... };   class Entertainment:public DVD { ... public Entertainment(QString anID, QString aTitle, QString aPrice, QString aType, QString aRating); };   class Educational: public DVD { ... public Educational(QString anID, QString aTitle, QString aPrice, QString aSubject, QString aGradeLevel); ... };

Note Entertainment and Educational are derived from DVD. Assuming my code above is correct...

Why does this line of code fail telling me that there is no such constructor for DVD
Language: C++ (QT)
DVD* dvd1 = new Entertainment("111", "Three Colours: Blue", 145.50, "Drama", "PG10");

I know this is not required for question 5... but I'm finding that as I write the code out that I am missing little gems of information all over. So any help would be appreciated. Thank you.
Re: Exam 2008 Question 5
November 15, 2009 06:31PM
Your constructor has 5 QString types, and you used a double for your 3rd variable.
avatar Re: Exam 2008 Question 5
November 15, 2009 08:01PM
Thanks franlowe,

That was embarassingly simple on my part.
Re: Exam 2008 Question 5
November 15, 2009 08:20PM
Not to worry, I think we all have those moments more often than we care to admit.
Anonymous User
Re: Exam 2008 Question 5
November 15, 2009 08:42PM
yup. the only reason we spot them is because we've made the same mistake over and over again
Sorry, only registered users may post in this forum.

Click here to login