Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Problem Statement:

 

In continuation of the assignment no. 1, consider the following class diagram (a part from Assignment no. 1 solution), detailed description of the diagram is given in the table.

                       

 

Table:

 

Class Name

Attribute Name

Attribute Data Type

Behavior (Functions)

Company

Comp_Name

Character Pointer

- Default Constructor

        - Profit_Report()

        - Financial_Statement()  

Registration_No

Character Pointer

Transport

Weight

Integer

 

-          Default Constructor

-          Carray_Goods()

Capacity

Integer

Speed

Integer

Land_Transport

Transportation_Mode

Character Pointer

 

-          Default Constructor

Vehicle_Type

Character Pointer

Air_Transport

Aircraft_Type

Character Pointer

 

-          Default Constructor

Aircraft_Name

Character Pointer

 

Length

Integer

 

Room

Width

Integer

 

-          Default Constructor

-           Store()

 

 

 

 

Hall

             Length

Integer

-          Default Constructor

-          Store()

Width

Integer

 

 

 

 

 

You are required to map (implement/Code) this class diagram into C++.

Make sure that your solution must contain ONLY classes’ definitions given in the diagram, definitions of all attributes and proper declaration and definitions of member functions including constructors that are given in the above table.

 

Detail of some Member Functions:

 

Profit_ Report( ):              This function prints the annual profit of the company.

Financial_Statement( ):   This function prints the annual financial statement of the company.

Carry_Good( ):                Each transport has carrying goods functionality.

 

Note:  

  1. The body of all member functions should be empty, while the constructors should have code which initializes the objects.
  2. In main function you may print a simple “cout” statement in order to check your program for syntax errors.
  3. You must also implement inheritance and aggregation.

 

Lectures Covered:  This assignment covers Lecture #    07-10

Deadline:         Your assignment must be uploaded/submitted at or before. May 20, 2014

 

Views: 10587

Attachments:

Replies to This Discussion

how non parametrize?

hmmmm,,,, good work

sir iss solution mein inheritance kidhr lgai  hy???

es code ki source file compile nahe ho rahi ....bhai!!

#include
#include
using namespace std;
class Transport
{
public:
// class constructor
Transport();
//
void Carray_Goods();
// class destructor
~Transport();
private:
int Weight;
int capacity;
int speed;
};

Transport::Transport(void){cout"Transport";} Transport::Carray_Goods(void){cout"Carrying Goods";} class Land_Transport : private Transport { public: // class constructor Land_Transport(); // class destructor ~Land_Transport(); private: char* Transportation_Mode; char* Vehicle_Type; }; Land_Transport::Land_Transport(void){cout"Land_Transport";} class Air_Transport: private Transport { public: // class constructor Air_Transport(); // class destructor ~Air_Transport(); private: char* Aircraft_Type; char* Aircraft_Name; }; Air_Transport::Air_Transport(void){cout"Air_Transport";} class Room { public: // class constructor Room(); void Store(); // class destructor ~Room(); private: int length; int weight; }; Room::Room(void){cout"Room";} Room::Store(void){cout"Store";} class Hall { public: // class constructor Hall(); void Store(); // class destructor ~Hall(); private: int length; int weight; }; Hall::Hall(void){cout"Hall";} Hall::Store(void){cout"Store";} class Company { public: // class constructor Company(); void Profit_Report(); void Financial_Statement(); void GetTransport(&Transport transport) // class destructor ~Company(); private: char* Comp_Name; char* Registration_No; Room *room; Hall *hall; }; Company::Company(void){cout"Company";} Company::Profit_Report(void){cout"Profit_Report";} Company::Financial_Statement(void){cout"Financial_Statement";}

Dear friend Tariq sb .i first arranged your code.than  I could not understand the above highlighted code kindly explain it.

Attachments:

#include
#include
using namespace std;
class Transport:
{
public:
// class constructor
Transport();
void Carray_Goods();
// class destructor
~Transport();
private:
int Weight;
int capacity;
int speed;
};

Transport::Transport(void){cout"Transport";}

Transport::Carray_Goods(void){cout"Carrying Goods";}

 

class Land_Transport :

private Transport           (why you use this as compare to first class you did not use kindly explain)

{

 public:

// class constructor

Land_Transport();

// class destructor

~Land_Transport();

private:

char* Transportation_Mode;

char* Vehicle_Type;

};

Land_Transport::Land_Transport(void){cout"Land_Transport";}

 

 

class Air_Transport:

private Transport           (why you use this as compare to first class you did not use kindly explain)

{

public:

// class constructor

 Air_Transport();

// class destructor

~Air_Transport();

private:

char* Aircraft_Type;

char* Aircraft_Name;

};

Air_Transport::Air_Transport(void){cout"Air_Transport";}

 

class Room :

{

public:

// class constructor

Room();

void Store();

// class destructor

~Room();

private:

int length;

int weight;

};

Room::Room(void){cout"Room";}

Room::Store(void){cout"Store";}

 

class Hall

 {

 public:

 // class constructor

 Hall();

void Store();

// class destructor

~Hall();

private:

int length;

int weight;

};

Hall::Hall(void){cout"Hall";}

 Hall::Store(void){cout"Store";}

 

 class Company

{

 public:

// class constructor

Company();

void Profit_Report();

void Financial_Statement();

void GetTransport(&Transport transport)               (why you use this as compare to first class you did not use kindly explain)

 

 // class destructor

~Company();

private:

char* Comp_Name;

char* Registration_No;

Room *room;     (why you use this as these attribute are not mention in assignment you did not use kindly explain)

 

 Hall *hall;         (why you use this as these attribute are not mention in assignment kindly explain)

 

};

 Company::Company(void){cout"Company";}

Company::Profit_Report(void){cout"Profit_Report";} Company::Financial_Statement(void){cout"Financial_Statement";}



Dear friend Tariq sb .i first arranged your code.than  I could not understand the above highlighted code kindly explain it. i m not good in cs304 so kindly explain me.

anyone can send me solution?or sale me solution?

plz solution file 

 where is solution,,,,,

Find the correct code file that is executing...

Attachments:

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service