Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design the UML diagram showing only the classes #include using namespace std; class Order{ private: // declaring data members int OrderID; int TableNumber; bool Ready;

  1. Design the UML diagram showing only the classes

    #include

    using namespace std;

    class Order{

    private:

    // declaring data members

    int OrderID;

    int TableNumber;

    bool Ready;

    string Ordered_food;

    bool Delivered;

    public:

    // default constructor

    Order(){

    OrderID = -1;

    TableNumber = -1;

    Ordered_food = "";

    Ready = Delivered = false;

    }

    // parameterized constructor

    Order(int id, int tno, string order){

    OrderID = id;

    TableNumber = tno;

    Ordered_food = order;

    Delivered = Ready = false;

    }

    // set delivered to true

    void MarkDelivered(){

    Delivered = true;

    }

    // return delivery status

    bool isDelivered(){

    return Delivered;

    }

    // return ready status

    bool isReady(){

    return Ready;

    }

    // set Ready to true

    void MarkReady(){

    Ready = true;

    }

    // print order details

    void OrderDetails(){

    cout << "Order ID: " << OrderID << endl;

    cout << "Table Number: " << TableNumber << endl;

    cout << "Ordered food: " << Ordered_food << endl;

    cout << "Order Ready?: " << Ready << endl;

    cout << "Order Delivered?: " << Delivered << endl;

    }

    };

    int main()

    {

    // testing the above class

    Order order(1, 20, "Pasta");

    order.OrderDetails();

    order.MarkReady();

    order.OrderDetails();

    order.MarkDelivered();

    order.OrderDetails();

    return 0;

    }

class chef { public: string chef_Name; int chef_id; int Num_order; int Assigned_order; void set_Name(string name)//set the chef name { chef_Name=name; } void set_Id(int id)//set the chef id { chef_id=id; } string getName()//return chef name { cout<<" chef Name="<

};

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions