We are Permanently Move to vupk.net Please Join us there.
Showing posts with label CS304. Show all posts
Showing posts with label CS304. Show all posts

CS304 VU Current Final Paper Spring July 2012

1. two advantages of getter function? 2 marks
2. Which is best place to close file in try block of class? (2 marks)
3. Is it possible to make virtual function?  2 marks
4. 3 advantage of Iterate over cursors? 3 marks
5. Create a vector array of length 8.
6. Create a vector array of length 8, and also initialize the elements of this array with values 0 1 2 3 4 5 6 7. 5 marks

CS304 GDB Solution Spring July 2012



CS304 gdb solution 

TOPIC:
Is polymorphism as a tool for updating and versioning of 
Software? Support your answer with solid arguments.

Polymorphism is often referred to as the third pillar of object-
oriented programming, after encapsulation and inheritance. Polymorphism is a Greek word that means "many-shaped" and it has two distinct aspects.The version algebra is the polymorphic algebra and involves two categories of operators intra-class and inter class operators.The polymorphic algebra is define to be able to update properties of class as well as that of versions and the update relationships between classes and relationships between the versions. Hence the Polymorphism is useful tool for updating and version of software in object oriented programming

CS304 Assignment # 4 Idea Solution 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>