PDA

View Full Version : cs304 assignment no 2 fall 2011 solution required



Xpert
11-19-2011, 01:11 AM
Object Oriented Programming (CS304)

Assignment No.2


Deadline

Your assignment must be uploaded before or on Monday 21st of November, 2011


Rules for Marking

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
o The assignment submitted in a format other than .cpp.


Objectives

The objectives of this assignment are,



Giving the idea of practical implementation (prototype in C++) of basic object oriented concepts like abstraction, encapsulation, inheritance, association, aggregation and sub typing to students.









Assignment:


In Assignment No.1 we developed Object Oriented Model for three modules of E-Card System. You tried to solve assignment by following the procedure discussed in lecture as well as guidelines given in assignment. Last assignment solution also requires a comprehensive understanding of domain knowledge. As much as you gain knowledge about domain, there will be more refined solution.

Now In assignment No.2 you are required to provide a practical prototype in c++ only for the following class diagram. Mean you will have to provide the solution in the form of classes in c++.









Class diagram for assignment No. 2








Also note that you don’t have to give actual implementation in c++ but simple stereotype (sketch) in the form of c++ code mentioning class names their parameters and functions with access specifiers.

You also have to show the relationship (inheritance, association, aggregation, composition) between classes in proper c++ syntax with comments.

Note: Every student will follow the above mentioned Object Model in order to develop solution of assignment No.2.



Example Object Model and its Prototype











































#include<iostream.h>
#include<conio.h>

class Lesson{ // Lesson class

// Lesson class attributes
// Access specifier is by default private
int ID;
topic * title;//aggregation relationship b/w lessons and topic
int NoOfLessons;

public:// public access specifier

// Lesson class functions/ operations
void add();
void remove();
bool select();
void search();
void View();
void print();
void download();
};// end of Lesson class
// ************************************************** **********
// ************************************************** **********
// ************************************************** **********


class course{ //course class
//Attributes of course class
char * code;
topic title; //composition relationship b/w Course and topic
char * courseName;
int duration;
Lesson NoOfLessons;//composition relationship b/w Course and Lesson

public:// public access specifier

//course class functions/operations
void add();
bool select();
void View();
void read();

};// end of course class

// ************************************************** **********
// ************************************************** **********
// ************************************************** **********

class StudyProgram{ // StudyProgram class
//Attributes of StudyProgram
// Access specifier is by default private
char * Code;
char * title;
char * ProgramName;
course duration; //composition relationship b/w StudyProgram and course

public:// public access specifier
bool select();
char * ViewCourseList;
};// end of StudyProgram class

// ************************************************** **********
// ************************************************** **********
// ************************************************** **********

class topic{ // topic class

//topic class attributes
// Access specifier is by default private
int ID;
char * title;

public: // public access specifier

// topic class functions/ operations
void add();
void remove();
bool select();
void search();
void View();
void print();
void download();
};// end of topic class

// ************************************************** **********
// ************************************************** **********
// ************************************************** *********




You will write such code for your E-Card system.


Note: You are required to submit only .cpp file. Word document or any other file format will strongly be discouraged.

Hina Khan
11-19-2011, 03:06 AM
hy bhai g solution kb aye ga???

Xpert
11-20-2011, 03:30 AM
I don't have any idea because i am not working on it.

Hina Khan
11-21-2011, 07:56 PM
q bhai g hm se dushmani hy kia???

Hina Khan
11-21-2011, 07:59 PM
agar work nahi kr rahy to ye q upload ki .bachon ko kush karny k lye??? ye to lms pr daikh hi chuky.
ganndy bhai....

akmalalvi
11-21-2011, 09:14 PM
ye sala logon ko ullo banaya hai is ne is ki website pe lanat

nomiprinc
11-21-2011, 09:15 PM
muja ak saal sa is site sa kabi bi kisi subject ka solution nahi mila.
Xpert na apni jasi bakwas site rakhi howi ha. ager work nahi ker sakta to chod do is site ko.
lagta ha ab muja students ki help ka lia site banani pata gi. or unqreeb banoin ga Inshallah.

kashif151
11-21-2011, 10:42 PM
yaro solution ka kuch socho

kashif151
11-21-2011, 10:46 PM
yar aj last date hey kahein say solution find karo

Amir Khan
11-22-2011, 12:44 AM
Xpert to sala shkal say hi Dako lagta hai. :smileys9:

ladak
11-22-2011, 12:55 AM
Pakka Dakooooooooooooo

ladak
11-22-2011, 01:01 AM
mujay aik solution mila hai. here it is:::

#include<iostream.h>
#include<conio.h>

class Users{ // User class

// Userclass attributes
// Access specifier is by default private
int ID;
char Name;
string Address;

public:// public access specifier

// User class functions/ operations
void viewcard();
void searchcard();
};// end of User class
// ************************************************** **********
// ************************************************** **********

class Administrator{ // Administrator class
//Attributes of Administrator class
int ID;
char Name;
string Address;
password password;

public:// public access specifier

// Administrator class functions/operations
void addcard();
bool deletecard();
void Viewcard();
void searchcard();
void sendcard();
};// end of Administrator class

// ************************************************** **********
// ************************************************** **********

class Members{ // Members class
//Attributes of Members
// Access specifier is by default private
int MemberID;
char Name;
string Address;
// Member class functions/operations

void Viewcard();
void searchcard();
void sendcard();

};// end of Member class

// ************************************************** **********
// ************************************************** **********

class Memberlist{ // Memberlist class

//Memberlist class attributes
// Access specifier is by default private
Char membername;
Password password;
Char status;
Char country;

public: // public access specifier

// memberlist class functions/ operations
void verifymembers();
void addmembers();
void getrecord();
void showmemberlist();
};// end of memberlist class

// ************************************************** **********
// ************************************************** **********

class card{ // card class

//card class attributes
// Access specifier is by default private
Int cardID;
Char cardname;
Int BGid;
Int MUid;
Date date;

public: // public access specifier

// memberlist class functions/ operations
void sendcard();

};// end of card class

// ************************************************** **********
// ************************************************** **********
class cardlist{ // cardlist class

//cardlist class attributes
// Access specifier is by default private
Int cardID;
Char cardname;


public: // public access specifier

// memberlist class functions/ operations
Void delete();
void addcard();
void getcard();

};// end of cardlist class

// ************************************************** **********
// ************************************************** **********
class Categorycatolog{ // Categorycatolog class

// class attributes
// Access specifier is by default private
Int catID;
Char catname;

public: // public access specifier

// memberlist class functions/ operations

void addcatagory();
void deletecatagory();
void addcard();
void deletecard();
void showcard();
};// end of catagorycatolog class

// ************************************************** **********
// ************************************************** **********

saif.ullah
11-22-2011, 01:01 AM
hahahha na kro yr bachy ki jan lo gy
jis jis ko chahya wo mujhy apni apni id btya mein mail krta hn

Xpert
11-22-2011, 01:02 AM
HAHAH dako.. yar dako rani movie ayi thi. mujay kidar say dako bana dia. main ajj kal busy hon is waja say na. ab kuch aur kam bhi tu karnay hotay han. so please don't mind baki bhi tu han share ker dia karen na. yahan par kia jata hai kuch bhi tu nahi.

ladak
11-22-2011, 01:11 AM
share kar diya hai, shayad kisi kay kaam aa jaye...

ladak
11-22-2011, 01:29 AM
is forum par post karnay may aap ko kiya problem hai, aap ko sharam aati hai.???

makyle
11-22-2011, 01:41 AM
gays is chawal ko chod do yeh lo answer.
but make some changes in this each student
#include<iostream.h>
#include<conio.h>
{ // administrator class
// normal Members class attributes
// Access specifier is by default private or normal class
int ID;
char name;
user * user; //aggregation relationship b/w user and machine
int card_no;

public: // specifer public access

// search class functions/ operations
void search();
void View();
void cardtype();
void send();
}; // end of entry class


class members { //Members class
//Attributes of member class
char * id;
topic name; //composition relationship b/w member and card
char * address;
int cardtype;
memberslist members; //composition relationship b/w members and cardlist
public: // public access specifier
//Members class functions/operations
void add();
bool select();
void View();
void send();

}; // end of members class

// ************************************************** **********

class cards // card types class
{
//Attributes of cards
// Access specifier is by guest or norma users
char * id;
char * name;
char * cardtype;
date of expire ; //composition relationship b/w StudyProgram and course

public:/ // public access specifier
catag select();
char * ViewCardsList;

}; // end of StudyProgram class
// ************************************************** **********


class admin{ // Admin class

//admin class attributes
// Access specifier is by administrator
int ID;
char * title;

public: // public access specifier
// administrator class functions/ operations
void add();
void remove(); //remove access
bool select(); //select access
void edit(); //edit access function
void View(); //view access function
void print(); //rint access function
void download(); //download access function
void upload(); //update access function

}; // end of topic class

makyle
11-22-2011, 01:45 AM
this is also correct but some changes required. accordingly to your own sence

makyle
11-22-2011, 01:47 AM
#include<iostream.h>
#include<conio.h>

class Users{ // User class

// Userclass attributes
// Access specifier is by default private
int ID;
char Name;
string Address;

public:// public access specifier

// User class functions/ operations
void viewcard();
void searchcard();
};// end of User class
// ************************************************** **********
// ************************************************** **********

class Administrator{ // Administrator class
//Attributes of Administrator class
int ID;
char Name;
string Address;
password password;

public:// public access specifier

// Administrator class functions/operations
void addcard();
bool deletecard();
void Viewcard();
void searchcard();
void sendcard();
};// end of Administrator class

// ************************************************** **********
// ************************************************** **********

class Members{ // Members class
//Attributes of Members
// Access specifier is by default private
int MemberID;
char Name;
string Address;
// Member class functions/operations

void Viewcard();
void searchcard();
void sendcard();

};// end of Member class

// ************************************************** **********
// ************************************************** **********

class Memberlist{ // Memberlist class

//Memberlist class attributes
// Access specifier is by default private
Char membername;
Password password;
Char status;
Char country;

public: // public access specifier

// memberlist class functions/ operations
void verifymembers();
void addmembers();
void getrecord();
void showmemberlist();
};// end of memberlist class

// ************************************************** **********
// ************************************************** **********

class card{ // card class

//card class attributes
// Access specifier is by default private
Int cardID;
Char cardname;
Int BGid;
Int MUid;
Date date;

public: // public access specifier

// memberlist class functions/ operations
void sendcard();

};// end of card class

// ************************************************** **********
// ************************************************** **********
class cardlist{ // cardlist class

//cardlist class attributes
// Access specifier is by default private
Int cardID;
Char cardname;


public: // public access specifier

// memberlist class functions/ operations
Void delete();
void addcard();
void getcard();

};// end of cardlist class

// ************************************************** **********
// ************************************************** **********
class Categorycatolog{ // Categorycatolog class

// class attributes
// Access specifier is by default private
Int catID;
Char catname;

public: // public access specifier

// memberlist class functions/ operations

void addcatagory();
void deletecatagory();
void addcard();
void deletecard();
void showcard();
};// end of catagorycatolog class

// ************************************************** **********
// **************************************************

makyle
11-22-2011, 01:50 AM
Mr. Amir
please make some changes accrdingly othere wise it will be cancled.

rabeel
11-22-2011, 02:30 AM
is it working or not?

nomiprinc
11-22-2011, 02:46 AM
Lo lalo Assignment

nomiprinc
11-22-2011, 02:50 AM
Lo Lalo Yah ha cs304 ka assignment ka sol

Hina Khan
11-22-2011, 03:51 AM
bhaayon plz itny bhi bury words mat use karo.ap log to abuse hi karny lagy ho.hmen khud effort karni chahye ye to just help hy mil gayi to theek
warna apni koshish.tension to really hoti hy lekin ab xpert bichary ne to nahi kaha na k mery intzaar may date expire kr do.be cool

harib raza
11-22-2011, 04:50 AM
This is tooo mach guys
kahin se b nahi lag raha k ap masters ya greduation k student ho