Advertisement
JackHoughton00

Bacteria Growth

Mar 6th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. package bacteriagrowth;
  2. import java.util.Scanner;
  3. public class BacteriaGrowth {
  4. public static void main(String[] args) {
  5. Scanner input = new Scanner(System.in);
  6. double y,n,k,t,kt = 0;
  7. System.out.print("Please enter the initial bacteria amount:");
  8. n = input.nextDouble();
  9. System.out.print("Please enter the constant value:");
  10. k = input.nextDouble();
  11. System.out.print("Please inter the amount of time: ");
  12. t = input.nextDouble();
  13. y = (int)(n*Math.exp(k*t));
  14. System.out.println(y+"bacteria will be present after"+t+"hours");
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement