AssignmentView more random threads:
- Notification - MBA 2-year program studetns admitted up to...
- i am getting this error on vu content library
- MTH001 - Elementary Mathematics fall 2010 First quiz
- Online Virtual University Date Sheet Fall 2014 MidTerm...
- CS101 Introduction to Computing quiz fall 2010 November
- Virtual University of Pakistan Celeberating 10th Birthday...
- Excite Cup Know about your capabilities by participating in...
- check online Virtual University Spring 2014 Mid Term Exams...
- Virtual University Revised Dates Academic Calendar Fall 2014
- Applying for Virtual University Final Transcript of Record...
Introduction:
In Assignment No.1 you developed Object Oriented Model for Library Management System and in Assignment #2 you developed its practical prototype in c++ that you didn’t 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 showed the relationship between classes in the form of inheritance mentioning the name of class/classes from which they have been derived in proper c++ syntax.
Sponsored Links
Description:
As you know in a header file (.h) for a class we include its declaration while in implementation file (.cpp) part we add implementation of all methods of that class. In this assignment you have to do exactly the same for only one class in your Dev c++ project you already had created in Assignment No.2 (Library Management System), you have to add the following for each class,
1. Necessary attributes with suitable data types in its header file (Data Members)
2. Constructor and Destructor of that class
3. Getters and Setters for all its Data Members (also make them const where required)
Important Note:
• In this assignment code given for any class (Library, student, administrator etc) should be correct however you are NOT required to create this class’s objects and call their methods in main these things might be required in next assignment.
• Although it is not requirement you can start from code generated using argoUML for each class.
Uploading Instructions:
You have to upload your single zipped dev c++ project as you did in Assignment No. 2 and 3
Appendix:
Example code for a Course class to store any course attributes is given below similarly you have to add code for all your classes in your Dev c++ project,
Course.h
Course.cppCode:#include <iostream> using namespace std; class Course { public: Course(char * , char * , int ); void setName(char *); char *getName() const ; void setCode(char *); char *getCode() const ; int gerCreditHours(); void setCreditHours(int); int getCreditHours()const ; ~Course(); private: char *name; char *code; int credithours; };
Solution can be found in the attachmentCode:Course::Course(char * _name, char * _code, int _credithours) { name = new char[strlen(_name)]; strcpy(name,_name); code = new char[strlen(_code)]; strcpy(code,_code); credithours = _credithours; } void Course::setName(char * _name) { if ( name !=NULL ) delete []name; name = new char[strlen(_name)]; strcpy(name,_name); } char * Course::getName() const { return name; } void Course::setCode(char * _code) { if (code != NULL) delete []code; code = new char[strlen(_code)]; strcpy(code,_code); } char * Course::getCode() const { return code; } void Course::setCreditHours(int _credithours ) { credithours = _credithours; } int Course::getCreditHours() const { return credithours; } Course::~Course() { if(name != NULL) delete []name; if (code != NULL) delete []code; }
Urgent call: 03455242488. | Virtual University Assignments
Virtual University GDBs | Virtual University Papers | Vu Projects | Vu Handouts
About Expert
There are currently 1 users browsing this thread. (0 members and 1 guests)