Converts a problem statement into class diagram.
Converting a problem statement into class diagram.
“Let’s assume a firm called “Pakfood Internationals”, that is running an export trade business of vegetables from Pakistan to 3 continents Africa, Asia and Europe. The company is using three kinds of transport i.e. Land transport, Sea transport, and Air transport to carry goods for shipments. It uses Land and Sea transport from Pakistan to South East Asia, Middle East, Far East, and Africa. Moreover, it uses sea and air transport for European countries. It also has cold rooms and halls available to rent in for customers’ small and large orders respectively”
You have to use standard UML notations for objects, classes, and their associations.
Besides problem statement; objects, properties, and functions of a system can also be extracted from domain knowledge. You have to consider all OOP concepts like abstraction, encapsulation, inheritance, association, generalization, and specialization wherever applicable.
To learn how to convert Problem Statment into UML class diagram click here: Step-wise procedure to translate a problem statement into class diagram
Consider the following class from the scenario discussed in task 1:
Suppose Pakfood Company provides so many rooms to rent in for storage purposes. The shape of all rooms is rectangular, and you being a part of development team are assigned a task to calculate room area before allocating it to customers. If the company’s order is so large that it cannot be accommodated in a single room, then, it will hire more than one room for its order. Suppose that every order requires at least two rooms.
Your task is to, write a C++ program which implements Room class and operator overloading with attributes and operations (functions) given in the above class structure.
Hints: The attribute Area is a derived attribute, which means, its value can be calculated by multiplying Width with Length, i.e Area = Width * Length;
cin>>Room1; cin>>Room2;
, where Room1, and Room2 are objects of class Room.TotalArea= Room1 + Room2;
, make sure that TotalArea is a float/double type variable.cout<<Room1; cout<<Room2;
In continuation of the Task 1, consider the following class diagram (a part from Task 1 solution), detailed description of the diagram is given in the table.
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.
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.
Consider the following Class Diagram; detailed description of the diagram is given in the table:
In given class diagram, Transport is a base class; while Land Transport and Air Transport are its derived classes. You are required to implement above class diagram in C++. For this you have to use the concept of inheritance and polymorphism.