0
How can i write a program that computes the Biochemical Oxygen Demand in this equation?
BOD = L(1 - 10) index kt, where k = deoxyngenation rate constant, t = time and L = ultimate biological demand. Note use a function subprogram and print BOD for 5 different values of k, t and L.
4 Antworten
+ 1
Here you go:
#include <iostream>
#include <cmath>
using namespace std;
int BODE(int k, int t, int L){
return pow(L*(-9), k*t);
}
int main() {
int k;
int t;
int L;
for(int i = 0; i < 5; i++){
cout << "What is k? ";
cin >> k;
cout << k << endl;
cout << "What is t? ";
cin >> t;
cout << t << endl;
cout << "What is L? ";
cin >> L;
cout << L << endl;
cout << "BOD: " << BODE(k,t,L);
cout << endl << endl;
}
return 0;
}
+ 1
That is the code I made. It takes inputs of k t L 5 times. I would recommend reading the code and viewing how I did it. An example of input is:
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
0
What does the term "index" mean?
The equation is only:
BOW = L (1 - 10)?
0
raise to the power of kt