Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bacteriagrowth;
- import java.util.Scanner;
- public class BacteriaGrowth {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- double y,n,k,t,kt = 0;
- System.out.print("Please enter the initial bacteria amount:");
- n = input.nextDouble();
- System.out.print("Please enter the constant value:");
- k = input.nextDouble();
- System.out.print("Please inter the amount of time: ");
- t = input.nextDouble();
- y = (int)(n*Math.exp(k*t));
- System.out.println(y+"bacteria will be present after"+t+"hours");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement