Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Object Oriented Programming (CS304)

Assignment No.04


Total Marks                                                                                                             20




Your assignment must be uploaded before or on 26th May, 2012.

Rules for Making


It should be clear that your assignment will not get any credit if:


  • The assignment is submitted after due date
  • The assignment is copied




This assignment has been designed so that you would be able to implement the concept of Inheritance in OOP. After the completion of this assignment you should have a good grasp on how to implement.


  • Inheritance
  • Aggregation and Composition
  • Using basic constructs of OOP in a program


In previous assignments we have understood all the basics of the Song Library System including the Object Model Diagram and highlighted the Abstraction of classes in terms of attributes and functions prototype. Now it is time to implement the full system in parts, so this assignment is first step towards it.


















Object Model for 4th assignment:



In this assignment you have to code/implement the below said classes in running form these classes are,


  • Music Items
  • Music Category
  • Band
  • Artist
  • Album
  • Track
  • Folk Music
  • Classic Music
  • Film Music
  • POP Music



Now for implementing these three classes practically in c++ you have to define classes according to the requirements (solution of second assignment) given below:


  1. Implement data members and member functions for each class
  2. Implement constructor and destructor for each class
  3. Implement setters and getters functions for each class
  4. Implement different type of relations between these classes


Sample Example:


//Topic class

class topic{

    // Data members of Topic class

    int ID; 

    char  * Title;     

    char discription[200];


    //Public interface of topic class


    //Default constructor





    //parametrized constructor

    topic(int id, char *title){


    Title=new char[strlen(title)+1];



     //setter function for ID

    void setId() {

    int id;

    cout"\nEnter ID: ";





    void setTitle() {

     char pChar[50];

     coutendl"\nEnter Title: ";


     Title=new char[strlen(pChar)+1];




    void setTitle(char * title){




    void setdiscription(){

        cout"\nplease enter discription of title"endl;





    int getId(){

     return ID;



    char * getTitle(){

       return Title;



    void add(){


        cout"\nAdding new information in add method";






   bool select(){

        cout"Topic selection Area:"endl;

        int select;

        if (select==1)

        cout"\nTopic is selected"endl;


        cout"\nTopic is not selected"endl;



    int search(){

        cout"In Search Mehtod:"endl;

       int found=0;

       if (found)

                        return 1;


                        return 0;



    void View() {

        cout"Viewing the Information";


        cout"\nTitle is:" Title ;

        coutendl"\nDescription is:"discription[100];




    void print(){


        coutendl"\nPrinting the Information:"endl;





    void download(){


        cout"\nDownloading the information:"endl;

        cout"Downloading under processing, Please wait:"endl;

        cout"You are downloding the following:"endlTitle"file";

        cout" and the following discription"endldiscription"File";





    void remove(){


        cout"\nDeleting the information"endl;


        delete []Title;

        delete [] discription;










class SubTopic: public topic {  

     int SubID;

     char * title;

     char discription[100];




         void setSubID(){

             int subid;

             cout"Enter ID of Sub topic:";




         void setdiscription(char []){

             char dChar[200];

             cout"Enter discription of Sub topic:"endl;




         int getSubID(){

             return SubID;



        void setTitle(){

             char pChar[50];

             char dChar[200];

             coutendl"Enter Title : ";


             coutendl"Enter Title discription:";



             cout"Eligible for being a topic"endl;




             cout"Title just contains name and no description"endl;











Uploading Instructions:

Complete this assignment using single .cpp file. You have to upload your running .cpp file with no dependency to external .h or .cpp file other then built in header files like iostream etc (If not followed will be awarded zero marks).


Views: 8001


Replies to This Discussion

lyn g discuss kren

janab! agar ye wxpire hoti to LMS p SUBMIT ki option na aati ... pluc LMS p it june mistake they wrote may in the assignment

koi hay to discuss karo bai

krein discuss ..... kya problem arai hai?

ye assignmet already aa chuki hai ab sirf is ka C++ code likhna hai 

aqsa main assignment 3 ko object model kuch or hai aur assignment 4 ka kuch or different hain 2nu assignment

Here again the question is for example in following function of Track class

void playTrack();

// What this function suppose to implement??

should we run some .mp3 file when this function is called or what?

any1 have any idea...plz discuss....thx

i hvnt started solving it yet .... m waiting for the marks of assignment 3 .... so that by knowing the mistakes done it assignment 3, i can solve assignment 4 better ... even i asked sir to upload the marks as soon as possible ...... lets c what happens!

yes, aqsa said rite.

Hello fellows,I think assignment no.2 is very helpful to solve assignment is prototype but now we have to implement it.Am I right.

Hi Airborne!

I think it should be simply implemented by COUT messages. 

How can we implement these functions of Music Item class


Any idea?


yes Raziullah...i think it will simple implementations. but lil confuesd after impliment these Funcion what i do....Some1 help plx.........! i made my assignment almost just wanna conform .........!


Looking For Something? Search Below

© 2022   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service