Question

In: Computer Science

The probability that a telephony call will last t minutes can be approximated as - Probability...

The probability that a telephony call will last t minutes can be approximated as -

Probability that call lasts less than t minutes =1 - e-t/a

Where e = Euler’s constant (2.71828) and a = average call duration

Using the above probability function, write a program in C that

a. takes the average call duration (a) from the user,

b. then accepts the call duration to find the probability for (t) and

c. then calculates and prints the probability that a call lasts less than t.

The program should repeat the sequence of operations a to c until the user enters a value of 0 for either variable a or t in the steps a or b above

Solutions

Expert Solution

#include<stdio.h>
#include<math.h>

int main(){
   double a=1,t=1,p;
   while(a!=0&&t!=0){
       printf("Enter average call duration (a): ");
       scanf("%lf",&a);
       if(a!=0){
       printf("Enter call duration to find the probability for (t): ");
       scanf("%lf",&t);
       if(t!=0){
           p=1-exp(-t/a);
           printf("The probability that a telephony call will last %.2f minutes: %f\n\n",t,p);
       }  
       }
   }
   return 0;
}


Related Solutions

AT&T is the second-largest provider of mobile telephony and the largest provider of fixed telephony in...
AT&T is the second-largest provider of mobile telephony and the largest provider of fixed telephony in the United States, and also provides broadband subscription television services. The CEO of AT&T wants to know what will affect the Total Monthly Spending at AT&T (y) for a customer. So far, the company has information on customer’s age (X1). We have total 50 observations. 1). Using the knowledge you learned from Chapter 3 to summarize the Total Monthly Spending at AT&T and customer’s...
In an examination the probability distribution of scores (X) can be approximated by normal distribution with...
In an examination the probability distribution of scores (X) can be approximated by normal distribution with mean 64.9 and standard deviation 9.4. Suppose one has to obtain at least 55 to pass the exam. What is the probability that a randomly selected student passed the exam? [Answer to 3 decimal places] Tries 0/5 If two students are selected randomly what is the chance that both the students failed? [Answer to 3 decimal places] Tries 0/5 If only top 4% students...
The term t (in years) of a $200,000 home mortgage at 7.5% interest can be approximated...
The term t (in years) of a $200,000 home mortgage at 7.5% interest can be approximated by the function below, where x is the monthly payment in dollars. t = 13.375 ln( x/ x-1250) , x > 1250 (a) Use a graphing utility to graph the model.,     (b) Use the model to approximate the term of a home mortgage for which the monthly payment is $1390. (Round your answer to the nearest year.) ________ yr What is the total amount...
The price of crude oil during the period 2000-2010 can be approximated by P(t) = 6t...
The price of crude oil during the period 2000-2010 can be approximated by P(t) = 6t + 18 dollars per barrel (0 <= t <= 10) in year t, where t = 0 represents 2000. Russia's crude oil production over the same period can be approximated by Q(t) = ?0.08t2 + 1.2t + 5.5 million barrels per day (0 <= t <= 10). † Use these models to estimate Russia's daily oil revenue and also its rate of change in...
The amount of outstanding consumer debt? (in trillions of? dollars) is approximated by g(t)= 0.365362 *...
The amount of outstanding consumer debt? (in trillions of? dollars) is approximated by g(t)= 0.365362 * 1.068022^t, where t=0 corresponds to 1980. Find the year in which consumer debt is (a) $2 trillion (b) $9 trillion (a) The consumer debt will reach???$2 trillion in the latepart of year: ?(b) The consumer debt will reach???$9 trillion in late part of the year:
The wheels of a wagon can be approximated as the combination of a thin outer hoop,...
The wheels of a wagon can be approximated as the combination of a thin outer hoop, of radius rh = 0.315 m and mass 5.84 kg, and two thin crossed rods of mass 8.23 kg each. You would like to replace the wheels with uniform disks that are 0.0588 m thick, made out of a material with a density of 6910 kilograms per cubic meter. If the new wheel is to have the same moment of inertia about its center...
A thin airfoil can be approximated as a flat plate. The airfoil is set at an...
A thin airfoil can be approximated as a flat plate. The airfoil is set at an angle of 10° to an air flow with Mach 2, a temperature of –50°C, and a pressure of 50 kPa. Using linearized theory, find the pressures on the upper and lower surfaces of this wing.
The pregnancy length in days for a population of new mothers can be approximated by a...
The pregnancy length in days for a population of new mothers can be approximated by a normal distribution with a mean of 266 days and a standard deviation of 8 days. ​(a) What is the minimum pregnancy length that can be in the top 11​% of pregnancy​ lengths? ​(b) What is the maximum pregnancy length that can be in the bottom 4​% of pregnancy​ lengths?
The wheels of a wagon can be approximated as the combination of a thin outer hoop,...
The wheels of a wagon can be approximated as the combination of a thin outer hoop, of radius rh = 0.209 m and mass 4.51 kg, and two thin crossed rods of mass 7.80 kg each. You would like to replace the wheels with uniform disks that are 0.0588 m thick, made out of a material with a density of 5990 kilograms per cubic meter. If the new wheel is to have the same moment of inertia about its center...
A call center randomly selects and records customer calls. Call handling times in minutes for 20...
A call center randomly selects and records customer calls. Call handling times in minutes for 20 calls are as follows: 6, 26, 8, 2, 6, 3, 10, 14, 4, 5, 3, 17, 9, 8, 9, 5, 3, 28, 21, and 4. Please calculate the 10th quartile, 90th quartile, median, Q1, Q3, sample mean, and sample standard deviation of call handling times.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT