Question
Design the UML diagram showing only the classes #include using namespace std; class Order{ private: // declaring data members int OrderID; int TableNumber; bool Ready;
-
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started