Writing and evaluating a function modeling continuous exponential growth or decay given two outputs

Explanation
The model has the form
[tex]y=ae^{-kt}[/tex]Where a=initial amount
y= final amount
K= growth rate constant
t= time
When 140 kg of substance is left after 7 hours, the formula can be remodeled to be.
[tex]\begin{gathered} 140=400e^{-7k} \\ e^{-7k}=\frac{140}{400} \\ e^{-7k}=\frac{7}{20} \\ \ln (e^{-7k})=\ln (\frac{7}{20}) \\ -7k=\ln (\frac{7}{20}) \\ k=\frac{\ln(\frac{7}{20})}{-7} \\ \therefore k=\frac{\ln (\frac{20}{7})}{7} \end{gathered}[/tex]Therefore, the first solution is
[tex]y=400e^{-\ln (\frac{20}{7})\frac{t}{7}}[/tex]For part b we have 16 hours.
[tex]\begin{gathered} y=400e^{-\ln (\frac{20}{7})\frac{t}{7}}=400e^{-\ln (\frac{20}{7})\frac{16}{7}} \\ y=36.302\approx36\operatorname{kg}\text{ (To the nearest whole number)} \end{gathered}[/tex]Thus, the answer is 36kg