Object Oriented Programming Assignment 4 (CS304), Exercises of Computer Programming

Information about an assignment for the object oriented programming (oop) course (cs304) at the university level. The assignment focuses on implementing various classes such as music items, music category, band, artist, album, track, folk music, classic music, film music, and pop music in c++. Students are required to define classes according to the given requirements, which include implementing data members, member functions, constructors, destructors, setters, getters, and relations between classes.

Typology: Exercises

2011/2012

Uploaded on 08/01/2012

parmitaaaaa
parmitaaaaa 🇮🇳

4.2

(111)

173 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Object Oriented Programming (CS304)
1
Object Oriented Programming (CS304)
Assignment No.04
Total Marks 20
Deadline
Your assignment must be uploaded before or on 26th June, 2012.
Rules for Making
It should be clear that your assignment will not get any credit if:
o The assignment is submitted after due date
o The assignment is copied
Objectives
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.
o Inheritance
o Aggregation and Composition
o 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.
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Object Oriented Programming Assignment 4 (CS304) and more Exercises Computer Programming in PDF only on Docsity!

Object Oriented Programming (CS304) 1

Object Oriented Programming (CS304)

Assignment No.

Total Marks 20

Deadline

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

Rules for Making

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

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

Objectives

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.

o Inheritance o Aggregation and Composition o 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 Oriented Programming (CS304) 2

Assignment:

Object Model for 4 th^ assignment:

Object Oriented Programming (CS304) 4

strcpy(Title,title); } //setter function for ID void setId() { int id; cout<<"\nEnter ID: "; cin>>id; }

void setTitle() { char pChar[50]; cout<<endl<<"\nEnter Title: "; cin.getline(pChar,50); Title=new char[strlen(pChar)+1]; strcpy(Title,pChar); }

void setTitle(char * title){ Title=title; }

void setdiscription(){ cout<<"\nplease enter discription of title"<<endl; cin.getline(discription,200); }

int getId(){ return ID; }

char * getTitle(){ return Title; }

void add(){ cout<<"\n*****************************************\n"; cout<<"\nAdding new information in add method"; setTitle(); setdiscription(); cout<<"\n*****************************************\n"; }

Object Oriented Programming (CS304) 5

bool select(){ cout<<"Topic selection Area:"<<endl; int select; if (select==1) cout<<"\nTopic is selected"<<endl; else cout<<"\nTopic is not selected"<<endl; }

int search(){ cout<<"In Search Mehtod:"<<endl; int found=0; if (found) return 1; else return 0; }

void View() { cout<<"Viewing the Information"; cout<<"\n*****************************************\n"; cout<<"\nTitle is:"<< Title ; cout<<endl<<"\nDescription is:"<<discription[100]; cout<<"\n*****************************************\n"; }

void print(){ cout<<"\n*****************************************\n"; cout<<endl<<"\nPrinting the Information:"<<endl; cout<<"Title:"<<Title<<endl<<"Discription:"<<discription; cout<<"\n*****************************************\n"; }

void download(){ cout<<"\n*****************************************\n"; cout<<"\nDownloading the information:"<<endl; cout<<"Downloading under processing, Please wait:"<<endl; cout<<"You are downloding the following:"<<endl<<Title<<"file"; cout<<" and the following discription"<<endl<<discription<<"File"; cout<<"\n*****************************************\n";

}

Object Oriented Programming (CS304) 7

cin.getline(pChar,50); cout<<endl<<"Enter Title discription:"; cin.getline(dChar,200); if(strlen(dChar)>=90){ cout<<"Eligible for being a topic"<<endl; } else { cout<<"Title just contains name and no description"<<endl; } }

~SubTopic(){

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).