import java.math.*; 
public class BacteriaCount { 
	/** This is a constant value which determines the
	 * rate of reproduction of the bacteria in SECONDS.
	 * Note that this does NOT have the same units as 
	 * the total time, which is given in hours.
	 */
	public static final int SEC_TO_DIVIDE = 30; 
	
	/** This member function displays how many bacteria
	 * will be left after a certain amount of time.
	 * It will display both approximately how many bacteria are
	 * left and exactly how many are left.
	 * @param secondsToDivide - how long before one bacteria becomes two?
	 * @param hoursElapsed - how long before we count them?
	 */
	public static void ShowCount(int secondsToDivide,
			double hoursElapsed)	{
		// It's always a good idea to check input values
		if (secondsToDivide < 1)	{
			System.out.println("Error - secondsToDivide < 1");
			return;
			}
		
		if (hoursElapsed < 0)	{
			System.out.println("Error - hoursElapsed < 0.0");
			return;
			}

		// First, calculate the number of divisions: 
		int numDivisions = (int)(hoursElapsed*3600/secondsToDivide+.5);
		
		// Then, estimate how many bacteria we expect to see:
		System.out.println("(Number of divisions: " + numDivisions + ")");
		double dApproxNum = Math.pow(2.0, numDivisions);
		System.out.println("After " + hoursElapsed + " hours, there are roughly "
				+ dApproxNum + " Bacteria.");
		
		// Finally, display the EXACT number of bacteria present.
		// (It should agree very closely with the estimate!)
		
		/** This is the part YOU must implement!
		 * There may be a special type of java number
		 * that could help you!
		 */
		
		System.out.println("There are exactly:");
		System.out.println("You Calculate This!" + "\nbacteria!");
	}

	/** It is always to have a good idea to use a main in
	 * every class as a way to test your program
	 * @param args - pass a double value containing the total time
	 * 				in hours
	 */
	public static void main(String[] args)
	{
		if (args.length != 1) {
			System.out.println("You must supply the time in hours.");
			return;
		}
		
		/** This is the time in hours passed to the program. */
		double totTime = Double.parseDouble(args[0]);
		
		/* Call the key member function of our class. */
		ShowCount(SEC_TO_DIVIDE, totTime);
		
	}
}