Question: I want to write this question in c++ program And please, please do it in a simple way and use printf . Scanf. Thanks Problem
Problem Statement Write a C program that provides a platform for the user to use the probability distribution functions described above. The program should display a menu that enables the user to select the function to be executed or to exit the program. Once a certain function is selected, the program prompts the user to enter the required input arguments, calls the selected function, displays the results, and displays the menu again Functions In addition to the main function your program should include the following functions: 1. Menu function: it prints the menu, reads the user choice, calls the corresponding function, and prints the results. 2. Geometric: it implements the geometric distribution function, it takes p and x as parameters. Then it computes three values, () probability of the success (i) Mean (ni) variance as described above. 3. Poisson: it implements the Poisson distribution function, it takes and x as parameters. It returns the probability of observing x events in a certain time interval, the mean, and the variance as described above. 4. Factorial: it computes the factorial of an integer. It is called by the Poisson function to calculate x Hintxx(x-1) (x-2) (x-3)..3x2x1x 0! where O! ls 1. 5. readGeometricinput: to prompt the user to enter valid input arguments (x and p) of the geometric distribution. It allows the user to keep trying to enter the input arguments until valid data are entered. In other words, x=1,2,3,4,5 and p E [0,1] 6. readPoissoninput: to prompt the user to enter valid input arguments (x and lambda) of the Poisson distribution. It allows the user to keep trying to enter the input arguments until valid data are entered. In other words, x 0,12,3,4,5,.. and lambda is nonnegative. Problem Statement Write a C program that provides a platform for the user to use the probability distribution functions described above. The program should display a menu that enables the user to select the function to be executed or to exit the program. Once a certain function is selected, the program prompts the user to enter the required input arguments, calls the selected function, displays the results, and displays the menu again Functions In addition to the main function your program should include the following functions: 1. Menu function: it prints the menu, reads the user choice, calls the corresponding function, and prints the results. 2. Geometric: it implements the geometric distribution function, it takes p and x as parameters. Then it computes three values, () probability of the success (i) Mean (ni) variance as described above. 3. Poisson: it implements the Poisson distribution function, it takes and x as parameters. It returns the probability of observing x events in a certain time interval, the mean, and the variance as described above. 4. Factorial: it computes the factorial of an integer. It is called by the Poisson function to calculate x Hintxx(x-1) (x-2) (x-3)..3x2x1x 0! where O! ls 1. 5. readGeometricinput: to prompt the user to enter valid input arguments (x and p) of the geometric distribution. It allows the user to keep trying to enter the input arguments until valid data are entered. In other words, x=1,2,3,4,5 and p E [0,1] 6. readPoissoninput: to prompt the user to enter valid input arguments (x and lambda) of the Poisson distribution. It allows the user to keep trying to enter the input arguments until valid data are entered. In other words, x 0,12,3,4,5,.. and lambda is nonnegative
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
