Exponential problems almost always work off the growth / decay formula: A = P*e^
ID: 3650872 • Letter: E
Question
Exponential problems almost always work off the growth / decay formula:A = P*e^(k*t)
Where:
"A" is the ending amount of bacteria growing in a petri dish
"P" is the beginning amount of bacteria,
"k" is the growth or decay rate, and
"t" is time
Write a C program that implements the formula shown above. Will ask for the values of P, k and
t, and prints a table to the console that shows the value of A from 0 to t. For example, if P= 100
and k =0.250, and t =3:
At time t: Value of A
---------- -----------
0 100.0000
1 128.4025
2 164.8721
3 211.7000
Notice the format of the table that uses 10 spaces for t, and 10 spaces for A( 4 decimals ).
You may use the function double exp (double), found in <math.h>, to calculate the
exponential value.
Explanation / Answer
//adjust that space thing as cramster are neglecting more than spaces so i cant post that #include #include int main() { float P,k; int t; printf("Enter the value of P: "); scanf("%f",&P); printf("Enter the value of k: "); scanf("%f",&k); printf("Enter the value of t: "); scanf("%d",&t); printf(" At time t: Value of A "); printf("---------- ---------- "); int i; for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.