About a simple question..

Ask the user for the defect rate, the number of items that the inspector picks, the
number of shipments, and N = the number of shipments with at least one defective device.
Program should print the probability
of at least one defective device in a single shipment and the probability that there will be N shipments
containing at least one defective device.

If someone can help, great thx
closed account (E0p9LyTq)
Write some code that you think solves your homework. If it doesn't work, then post the code and what problems/errors you get. Then we can help you.
closed account (1vD3vCM9)
its your mission to learn at class, we aren't supposed to do your homework.
Below is something i wrote, i just dont know how to present the question.
//
//
//
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;

// Factorial function
double fact(double x){
if ((x < 0) || (x > 170)){
return -1;
} else if ((x == 0) || (x ==1)){
return 1;
} else {
return x*fact(x-1);
}
}

int main(void);{
The question he ask is
Follow the 5-step problem solving approach to write a C++ program that implements the previous example.
Your program should ask the user for the defect rate, the number of items that the inspector picks, the
number of shipments, and N = the number of shipments with at least one defective device. In the example
above, these numbers would be 0.03, 20, 10, and 3, respectively. Your program should print the probability
of at least one defective device in a single shipment and the probability that there will be N shipments
containing at least one defective device. In the example above, these numbers would be 0.4562 and 0.1602,
respectively. Your hand example must be di erent than the example above.
The rst thing that your program should print to the screen is a description of what the program does,
i.e., \This program computes ..." In other words, you can print the exact same thing that you write for
Step 1: Clearly state the problem. Then, your program should clearly ask for each of the input variables.
For example, your program should print something like \Please enter the defect rate: ", etc. Finally,
your program should clearly describe the output, i.e., do not just print two numbers to the screen with no
description
closed account (48T7M4Gy)
Step 1: Clearly state the problem. Then, your program should clearly ask for each of the input variables.
For example, your program should print something like \Please enter the defect rate: ", etc. Finally,
your program should clearly describe the output, i.e., do not just print two numbers to the screen with no description


So, what have you done about that step in your "factorial program"?
Topic archived. No new replies allowed.