Sponsored Links


Results 1 to 4 of 4

Thread: CS304 Object Oriented Programming Assignment No 2 Discussion Spring 2014

  1. #1
    Senior Member
    Join Date
    Oct 2012
    Posts
    323

    CS304 Object Oriented Programming Assignment No 2 Discussion Spring 2014

    Sponsored Links1


    CS304 Object Oriented Programming Assignment No 2 Solution and Discussion Spring 2014

    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
    Airraft_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.



    Sponsored Links

    Note:

    The body of all member functions should be empty, while the constructors should have code which initializes the objects.
    In main function you may print a simple “cout” statement in order to check your program for syntax errors.
    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

  2. #2
    Senior Member
    Join Date
    Oct 2012
    Posts
    323
    #include<iostream>

    #include<conio.h>

    using namespace std;

    // company Class//

    class Company{

    // Data Member Defination//

    private:

    char* Comp_Name;

    char* Registration_No;

    // Member Function Declaration//

    public:

    Company();

    Company(char* Comp_Name,char* Registration_No);

    void Profit_report();

    void Financial_Statement();

    ~company();

    };

    // Transport Class//

    class Transport{

    // Data Member Defination//

    private:

    int Weight;

    int Capacity;

    int Speed;



    // Member Function Declaration//

    public:

    Transport();

    Transport(int Weight,int Capacity,int Speed);

    void Carry_Goods();

    ~Transport();

    };

    // Land_Transport Class

    class Land_Transport{

    // Data Member Definaion

    private:

    char* Transportation_Mode;
    char* Vehical_Type;

    // Member Function Declaration//

    public:



    Land_Transport();
    Land_Transport(char* Transportation_Mode,char* Vehical_Type);

    ~Land_Transport();

    };

    //Air_Transport class//

    class Air_Transport{

    // Data Member Function//

    private:

    char* Aircraft_Type;

    char* Aircraft_Name;


    public:

    Air_Transport();

    Air_Transport( char* Aircraft_Type,char* Aircraft_Name);



    ~Air_Transport();

    };

    //Class Room//

    class Room{

    private:

    int Length;

    int Width;

    public:

    Room();

    Room(int Length,int Width);

    void Store();

    ~Room();

    };

    //Class Hall//

    class Hall{

    private:

    int Length;
    int Width;

    public:

    Hall();

    Hall(int Length, int Width);
    void Store();
    ~Hall();
    }

  3. #3
    Senior Member
    Join Date
    Oct 2012
    Posts
    323


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

    // company Class//

    class Company{

    // Data Member Defination//

    private:

    char* Comp_Name;

    char* Registration_No;

    // Member Function Declaration//

    public:

    Company();

    Company(char* Comp_Name,char* Registration_No);

    void Profit_report();

    void Financial_Statement();

    ~Company();

    };

    // Transport Class//

    class Transport{

    // Data Member Defination//

    private:

    int Weight;

    int Capacity;

    int Speed;

    // Member Function Declaration//

    public:

    Transport();

    Transport(int Weight,int Capacity,int Speed);

    void Carry_Goods();

    ~Transport();

    };

    // Land_Transport Class

    class Land_Transport{

    // Data Member Definaion

    private:

    char* Transportation_Mode;
    char* Vehical_Type;

    // Member Function Declaration//

    public:

    Land_Transport();
    Land_Transport(char* Transportation_Mode,char* Vehical_Type);

    ~Land_Transport();

    };

    //Air_Transport class//

    class Air_Transport{

    // Data Member Function//

    private:

    char* Aircraft_Type;

    char* Aircraft_Name;


    public:

    Air_Transport();

    Air_Transport( char* Aircraft_Type,char* Aircraft_Name);

    ~Air_Transport();

    };

    //Class Room//

    class Room{

    private:

    int Length;

    int Width;

    public:

    Room();

    Room(int Length,int Width);

    void Store();

    ~Room();

    };

    //Class Hall//

    class Hall{

    private:

    int Length;
    int Width;

    public:

    Hall();

    Hall(int Length, int Width);
    void Store();
    ~Hall();
    };

    int main()
    {
    cout"Program Working";

    getch();
    return 0;
    }


  4. #4
    Senior Member
    Join Date
    Oct 2012
    Posts
    323
    Guide me if my vectors are in wrong heading please. this assinment is total logical design , and will need deep thinking of so many people.

    Financial_Statement( ): This function prints the annual financial statement of the company.////////So this in an in file statement not a private variable stored data ,

    Financial_Statement( ): This function prints the annual financial statement of the company/// again this is an infile statement , and also needs a proper finacil statement in the file.which means Part of this is (Finance in the file for file stream)

    climb

    first thing. GO TO CS201 and pull out file stream and do some rehearsals of that.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 11-17-2014, 02:22 AM
  2. Replies: 1
    Last Post: 07-21-2014, 02:21 PM
  3. Replies: 0
    Last Post: 05-17-2013, 04:29 PM
  4. Replies: 1
    Last Post: 04-27-2013, 04:15 PM
  5. Replies: 17
    Last Post: 07-01-2011, 03:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft