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: 10578

Attachments:

Replies to This Discussion

mainy assignment to bna li hai per phir bhe aggregation or inheritance main confusion hai....

ager kisi student ko clear hai ye concept then tell me...!!

where is solution,,,,,

Aggregation:

             An aggregate object is one which contains other objects. like Class A contains Class B , Or Class A has instance of Class B.

Example:

  • Manager has N Employees for a project. 
  • Team has Players.
  • an Airplane class would contain Engine, Wing, Tail, Crew objects.

Used:

An aggregation is used whenlife of object is independent of container object But still container object owns the aggregated object.

team has players,if team dissolve,players 'll still alive/exist.

UML Notation:
Aggregations are represented by the line with diamond.

Syntax:

YE WALI FILE THEEK HAI..
ISKO EDIT KR K KRDO SEND... 

Attachments:

ye to run he ni ho ri he is me virus show ho raha he 

es program ke output kia hone chye thi?

kuch nhi..just check ur syntax..is it right according to assign requirments..

read 2nd point..

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.




#include<iostream>

using namespace std;

class Room
{
private:
int length;
int width;
public:
Room(){ length = width = 0; }
void store(){}
};

class Hall
{
private:
int length;
int width;
public:
Hall(){ length = width = 0; }
void store(){}
};

class Company
{
private:
char* comp_name;
char* registration_no;
Room room;
Hall hall;
public:
Company(){ comp_name = NULL; registration_no = NULL;}
void Profit_Report(){}
void Financial_Statement(){}
};

class Transport
{
private:
int weight;
int capacity;
int speed;
public:
Transport(){ weight = capacity = speed = 0; }
bool carry_goods(){}
};

class Land_Transport: public Transport
{
private:
char* transportation_mode;
char* vehicle_type;
public:
Land_Transport(){ transportation_mode = vehicle_type = NULL; }
};

class Air_Transport: public Transport
{
private:
char* aircraft_name;
char* aircraft_type;
public:
Air_Transport(){ aircraft_name = aircraft_type = NULL; }
};

int main()
{
cout"there is no syntax error\n your asignment is ok \n";
system("pause");
return 0;
}



Read more: cs304 assigenment 2 full functional solution today is last date enj... http://vustudents.ning.com/group/cs304objectorientedprogramming/for...

Read more at http://vustudents.ning.com/group/cs304objectorientedprogramming/for...

RSS

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

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