Answer:
C++ programming language (code) was used or applied in prompting a user to enter he number of series components in a system and the MTBFs for each component and then calculates the overall MTBF for the system using a FOR or a WHILE structure (loop).
Step-by-step explanation:
Solution
THE CODE
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int key;
// do while loop to run the program up to user wants to quit "to quit enter any number except 1 "
do
{
int n,i=0,mtbf[100]; //declaring array to store the mtbf values of the n components
float result=0,result1;
cout<<"\\ Enter number of components";
cin>>n;
while(i<n) // reading mtbf values into the array
{
cout<<"\\ Enter MTBF(Mean time between failure)==>";
cin>>mtbf[i];
i++;
}
i=0;
while(i<n) //in this while loop first i calculate the denominator part i.e (1/mtbf[i])+(1/mtbf[i])...
{
result+=(1.0/mtbf[i]);
i++;
}
result1=1/result; //this value calculate the total MTBF of the system
cout<<"\\ The MTBF of SYSTEM is\t"<<result1;
cout<<"\\ Another system to check? enter 1 for yes";
cin>>key;
}while(key==1);
}