write the UMLclass diagram #include #include using namespace std; const int maxrow = 10; string ChickenriceQuantity[maxrow] = {}; string ChickenriceType[maxrow] = {}; string search(); class Chickenrice { public: string ChickenriceQuantity[maxrow]; string ChickenriceType[maxrow]; void DisplayMenu(); void AddRecord(); void DeleteRecord(string search); void ShowRecord(string search); void DisplayAllRecord(); }; int main() { std::cout<<"MENU\n"; int option; system("CLS"); Chickenrice rice; do{ cout<<"1-Display menu"< cout<<"2-Add details"< cout<<"3-Delete details"< cout<<"4-View all list of chicken rice"< cout<<"5-View selected chicken rice record"< cout<<"6-EXIT"< cout<<"Select OPTION"< cin>>option; switch(option) { case 1: { rice.DisplayMenu(); getchar(); getchar(); break; } case 2: rice.AddRecord(); system("CLS"); break; case 3: rice.DisplayMenu(); break; case 4: rice.DisplayAllRecord(); break; case 5: cin.ignore(); cout<<"Enter the search chicken rice type"< getline(cin,ChickenriceType); cout< ShowRecord(ChickenriceType); break; } }while(option != 6); } void Chickenrice::DisplayMenu() { cout<<"The type of chicken rice "< cout<<"a.Salad chicken rice"< cout<<"b.Steam chicken rice"< cout<<"c.Fried chicken rice"< cout<<"d.Roasted chicken rice "< cout<<"e.Special chicken rice\n"< } void Chickenrice::AddRecord() { char Quantity[5]; char Type[10]; cin.ignore(); cout<<"Enter "; rice.DisplayMenu(); cout<<"\n"; cin.getline(Type,10); cout<<"Enter quantity :"; cin.getline(Quantity,5); for(int x =0;x { if(ChickenriceType[x] == "\0") { ChickenriceType[x] = Type; ChickenriceQuantity[x] = Quantity; break; } } } void Chickenrice::DeleteRecord() { int counter =0; for (int x=0; x { if (ChickenriceType[x] == search) { counter++; ChickenriceType[x] = ""; ChickenriceQuantity[x] = ""; cout<<"The item is delete sucessfully !!!\n"< break; } } if (counter == 0) { cout<<"The item's ID does not exist !!!"; } } void Chickenrice::ShowRecord(string search) { int counter =0; cout<<"Record of chicken rice:"< cout<<"-----------------------------------------"< cout<<"No. |Chicken Rice Type | Quantity\n"; for(int x=0; x < maxrow; x++) { if (ChickenriceType[x] == search) { counter++; cout<<""< } } if(counter ==0) { cout<<"No record found !!!\n\n"; } } void Chickenrice::DisplayAllRecord() { system("CLS"); cout<<"All current record of Chicken rice"< cout<<"------------------------------------------------------------------\n"; int counter = 0; cout<<"No. | Type | Quantity\n"; for(int x=0; x < maxrow; x++) { if (ChickenriceType[x] != "\0") { counter++; cout<<""< } } if(counter == 0) { cout<<"No record found!!!"< } cout<<"----------------------------------------------------------\n"; }
write the UMLclass diagram
#include<iostream>
#include<string>
using namespace std;
const int maxrow = 10;
string ChickenriceQuantity[maxrow] = {};
string ChickenriceType[maxrow] = {};
string search();
class Chickenrice
{
public:
string ChickenriceQuantity[maxrow];
string ChickenriceType[maxrow];
void DisplayMenu();
void AddRecord();
void DeleteRecord(string search);
void ShowRecord(string search);
void DisplayAllRecord();
};
int main()
{
std::cout<<"MENU\n";
int option;
system("CLS");
Chickenrice rice;
do{
cout<<"1-Display menu"< cout<<"2-Add details"< cout<<"3-Delete details"< cout<<"4-View all list of chicken rice"< cout<<"5-View selected chicken rice record"< cout<<"6-EXIT"< cout<<"Select OPTION"< cin>>option;
switch(option)
{
case 1:
{
rice.DisplayMenu();
getchar();
getchar();
break;
}
case 2: rice.AddRecord();
system("CLS");
break;
case 3: rice.DisplayMenu();
break;
case 4: rice.DisplayAllRecord();
break;
case 5:
cin.ignore();
cout<<"Enter the search chicken rice type"< getline(cin,ChickenriceType);
cout< ShowRecord(ChickenriceType);
break;
}
}while(option != 6);
}
void Chickenrice::DisplayMenu()
{
cout<<"The type of chicken rice "< cout<<"a.Salad chicken rice"< cout<<"b.Steam chicken rice"< cout<<"c.Fried chicken rice"< cout<<"d.Roasted chicken rice "< cout<<"e.Special chicken rice\n"< }
void Chickenrice::AddRecord()
{
char Quantity[5];
char Type[10];
cin.ignore();
cout<<"Enter ";
rice.DisplayMenu();
cout<<"\n";
cin.getline(Type,10);
cout<<"Enter quantity :";
cin.getline(Quantity,5);
for(int x =0;x {
if(ChickenriceType[x] == "\0")
{
ChickenriceType[x] = Type;
ChickenriceQuantity[x] = Quantity;
break;
}
}
}
void Chickenrice::DeleteRecord()
{
int counter =0;
for (int x=0; x {
if (ChickenriceType[x] == search)
{
counter++;
ChickenriceType[x] = "";
ChickenriceQuantity[x] = "";
cout<<"The item is delete sucessfully !!!\n"< break;
}
}
if (counter == 0)
{
cout<<"The item's ID does not exist !!!";
}
}
void Chickenrice::ShowRecord(string search)
{
int counter =0;
cout<<"Record of chicken rice:"< cout<<"-----------------------------------------"< cout<<"No. |Chicken Rice Type | Quantity\n";
for(int x=0; x < maxrow; x++)
{
if (ChickenriceType[x] == search)
{
counter++;
cout<<""< }
}
if(counter ==0)
{
cout<<"No record found !!!\n\n";
}
}
void Chickenrice::DisplayAllRecord()
{
system("CLS");
cout<<"All current record of Chicken rice"< cout<<"------------------------------------------------------------------\n";
int counter = 0;
cout<<"No. | Type | Quantity\n";
for(int x=0; x < maxrow; x++)
{
if (ChickenriceType[x] != "\0")
{
counter++;
cout<<""< }
}
if(counter == 0)
{
cout<<"No record found!!!"< }
cout<<"----------------------------------------------------------\n";
}

Step by step
Solved in 2 steps with 1 images









