Write a program to answer questions like the following: Suppose the species Klingon ox has a population of 100 and a growth rate of 15 percent, and it lives in an area of 1500 square miles. How long would it take for the population density to exceed 1 per square mile? Use the class Species in Listing 5.19 with the addition of the getDensity method from Self-Test Question 10.
This project requires a new version of Species that includes the density method from Self-Test Question 10. The main program uses this new version of the class and does the following: asks the user to enter data for the species (name, population and growth rate), the area (in square miles), and the target density. Note that the solution in this manual is generalized so that the user can enter any density; it is not hard-coded for 1 per square mile. Also note that a check is made to see if the density is already at or above the target before it enters the loop to calculate the number of years.
See the code in SpeciesWithDensity.java and YearsToDensity.
You might also like to view...
Answer the following statements true (T) or false (F)
1. Only the classes provided for file output contain a method named close. 2. The methods of the scanner class do not behave the same when reading from a text file as they do when used to read from the keyboard. 3. Using BufferedReader to read integers from a file requires the String input to be parsed to an integer type. 4. A full path name gives a complete path name, starting from the directory the program is in.
To return a window from full-screen view to its previous size, select ________ in the top-right corner of the window
A) Restore Down B) Back C) Resize D) Minimize
List, Process, and Cycle are categories of ________
Fill in the blank(s) with correct word
In dealing with structures, it is important to distinguish between a structure's form and its contents.
Answer the following statement true (T) or false (F)