I want to develop this program through the arrays to work on more than how Server؟
///////////////////////////////////////////////////
/// Program For Simulation 2 server in 2 line ////
/// Create By :Anakonda-ksa ////
////////////////////////////////////////////////
#include<iostream.h>
#include<stdlib.h>
#include<cstring.h>
int main()
{
int na=0 ,nb=0;
float time=0,total_time,no_of_completion_a=0,no_of_completionb=0,
total_area_a=0,event_time_a,total_busy_time_a=0,total_area_b=0,event_time_b,total_busy_time_b=0,
Ra,Rb,Xa,Xb,Ua,Ub,Na,Nb,prev_event_time_a,prev_event_time_b;
string event_type;
{
cout<<"PUT TOTAL TIME OF THE SYSTEM Or End SIM:\n";
cin>>total_time;
cout<<"\nPut EvENT LIST For First Line:\n";
cin>>na;
for(na=na;na>0;na--)
{
cout<<"\nPUT EVENT TYPE (Aa&Da): \n";
cin>>event_type;
cout<<"\nPUT EVENT TIME_A : \n";
cin>>event_time_a;
prev_event_time_a=time;
time=event_time_a;
if(na>0){
total_busy_time_a=total_busy_time_a+(time-prev_event_time_a);
total_area_a=total_area_a+(time-prev_event_time_a)*na;}
if(event_type=="Aa") //a=arrival customer on first server
{ na++;}
else if (event_type=="Da") //D=depurtue customer on first server
{na--;no_of_completion_a++;}}
Xa=no_of_completion_a/total_time;
cout<<"Xa:"<<Xa<<endl; // throughput for server1
Ua=total_busy_time_a/total_time; //utlization for server1
cout<<"Ua:"<<Ua<<endl;
Na=total_area_a/total_time;
cout<<"Na:"<<Na<<endl;
Ra=Na/Xa;
cout<<"Ra:"<<Ra<<endl; ///Response time for server1
/////////////////////////////////////////////////////////////////////////////////////////////////
cout<<"\nPut Enter LIST For Second Lines:\n";
cin>>nb;
for(nb=0;nb>0;nb--);
{
cout<<"\nPUT EVENT TYPE (Ab&Db): \n";
cin>>event_type;
cout<<"\nPUT EVENT TIME_b : \n";
cin>>event_time_b;
prev_event_time_b=time;
time=event_time_b;
if(nb>0){
total_busy_time_b=total_busy_time_b+(time-prev_event_time_b);
total_area_b=total_area_b+(time-prev_event_time_b)*nb;}
if(event_type=="Ab") // //a=arrival customer on second server
{ nb++;}
else if (event_type=="Db") //D=depurtue customer on second server
{nb--;no_of_completionb++;}}
Xb=no_of_completionb/total_time; //throughput for server2
cout<<"Xb:"<<Xb<<endl;
Ub=total_busy_time_b/total_time;//utlization for server2
cout<<"Ub:"<<Ub<<endl;
Nb=total_area_b/total_time; //
cout<<"Nb:"<<Nb<<endl;
Rb=Nb/Xb;
cout<<"Rb:"<<Rb<<endl;//Response time for server2
}
return 0;
}