California has been having strange weather recently causing cockroaches to grow to be 1 inch by 3 inches and to have offspring at a rate of 53% per day (assume a cockroach reaches adulthood in a day). You did not notice the 4 cockroaches under the refrigerator in the kitchen. Design a Java program to determine how long (in weeks) it will take the 4 cockroaches to multiply such that they will completely cover your kitchen floor, which measures 30 by 40 feet, and the total number of cockroaches covering the kitchen floor.
Your output statement should say something like “A total of X cockroaches will fully cover my apartment floors in Y.X weeks.
import java.util.Scanner;
public class JoshuaFlores_Exam4 {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int day = 1;
int floor = 120;
int weeks = 7;
int roachsize = 3;
double formula = 0.53 * roachsize * 4;
double time = (0.53 * roachsize * 4)/(7);
while (day = 1; day * weeks; day++){
while(formula <= 120){
formula++;
}
}
System.out.println("A total of 4 cockaroaches will fully cover my apartment floors in weeks:" + time);
}
}