/* Solution * CSE Account # */ import java.io.PrintStream; import java.util.Scanner; public class Growth { public static void main(String[] args) { PrintStream output = System.out; Scanner input = new Scanner(System.in); output.print("Enter the time in years : "); double time = input.nextDouble(); output.print("Enter the doubling time in years : "); double dblTime = input.nextDouble(); final int FACTOR = 2000; double num = FACTOR * Math.pow(2, time / dblTime); final int THOUSAND = 1000; long numRounded = Math.round(num); long numRoundedThousand = Math.round(num / THOUSAND); output.printf("%d transistors%n", numRounded); output.printf("%d thousands of transistors%n", numRoundedThousand); } }