C/C++ C++ program for give equations and error rectifier give program.

AI Thread Summary
The discussion revolves around a C++ program that calculates the expected waiting time (EWQ) in a queuing system using parameters such as arrival rate (LAM), service rate (MU), and the number of servers (N). The program includes a factorial function and iterates through various values of LAM to compute the traffic intensity (RO) and the expected waiting time. Key points include the use of mathematical functions for calculations, the significance of the parameters in queuing theory, and the implementation of loops for iterative calculations. The program also highlights the importance of proper function definitions and variable initialization in C++.
Anantharaman
Messages
2
Reaction score
0
#include<iostream.h>
#include<math.h>
#include<conio.h>
void main()
{
int n,fact();
float LAM, MU=3, RO, C=0.1, N=10, F1=0, EXX, EWQ;
clrscr();
for (LAM=0.1;LAM<=1.1;LAM=LAM+0.1)
{
RO=LAM/MU;
EXX=2/(MU*MU);
for(n=1;n<N-1;n=n+1)
F1=F1+(N-n)*pow(LAM*C,n-1)*exp(-LAM*C)/fact(n-1);
EWQ=((N-1)/(2*LAM))+((LAM*EXX)/(2*(1-RO)))-F1;
cout<<"RAO"<<RO<<"EWq"<<EWQ;
}
getch();
}
int fact()
{
int k;
if(k>1)
{
k=k*fact(k-1);
return(k);
}
else
return(1);
}
 
Technology news on Phys.org
Do you have a question?
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Back
Top