We are Permanently Move to www.VUpk.net Please Join us there.

CS304 Assignment # 4 Idea Solution June 2012

Wednesday 27 June 2012

CS304 Assignment # 4 Idea Solution Juns 2012

#include<string.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
//User Class
class User{
// Data members of user class
int Id;
char * name;
//Public interface of user class
public:
//Default Constructor
User(){
Id=-1;
name=NULL;
}
//parametrized constructor
User(int id, char *name){
Id=id;
this->name=new char[strlen(name)+1];
strcpy(this->name,name);
}
//Setter and Getter functions
void setId(int id) {
Id = id;
}
int getID(){
return Id;
}
void setName(char *name) {
this->name=new char[strlen(name)+1];
strcpy(this->name,name);
}
char * getName(){
return name;
}
void playTrack()
{
cout" Start playing the current track";
} };
class Listener :: public User;
{
public: void playTrack()
{
cout" Overloaded Method…";
cout" Start playing the current track";
} };
//Administrator Class class Administrator : public User{ // Data members of user class char * Password; //Public interface of user class
public: void getPassword(char * password)
{
cout" Map password in DB";
cout" Allow access to the system accordingly";
} /* Following code requires existence of Track, Album, Artist, and MusicCategory Classes to be implemented for execution*/ /* //Manipulating interfaces for Track
Track * addTrack()
{
cout"\n***************************************** \n";
cout"\n Adding new Track using add method";
cout"\n***************************************** \n";
Track track = new Track("Track Title"); return track;
}
void deleteTrack(Track * track)
{
cout"\n***************************************** \n";
cout"\n Deleting the Track"/p>

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...