Engineering

Computer ScienceQ&A LibraryThe U.S. Census Bureau projects population based on the following assumptions:- One birth every 7 seconds- One death every 13 seconds- One new immigrant every 45 secondsWrite a program to display the population for each of the next five years. Assume the current population is 312,032,486 and one year has 365 days.Hint: In Java, if two integers perform division, the result is an integer. The fractional part is truncated. For example, 5 / 4 is 1 (not 1.25) and 10 / 4 is 2 (not 2.5). To get an accurate result with the fractional part, one of the values involved in the division must be a number with a decimal point. For example, 5.0 / 4 is 1.25 and 10 / 4.0 is 2.5.Sample RunPopulation after 1 year: 3.148125827032967E8Population after 2 years: 3.1759267940659344E8Population after 3 years: 3.2037277610989016E8Population after 4 years: 3.2315287281318676E8Population after 5 years: 3.259329695164835E8Class Name: Exercise01_11Start your trial now! First week only $4.99!*arrow_forward*

Question

The U.S. Census Bureau projects population based on the following assumptions:*- One birth every 7 seconds**- One death every 13 seconds**- One new immigrant every 45 seconds*

Write a program to display the population for each of the next five years. Assume the current population is *312,032,486* and one year has *365* days.

Hint: In Java, if two integers perform division, the result is an integer. The fractional part is truncated. For example, 5 / 4 is 1 (not 1.25) and 10 / 4 is 2 (not 2.5). To get an accurate result with the fractional part, one of the values involved in the division must be a number with a decimal point. For example, 5.0 / 4 is 1.25 and 10 / 4.0 is 2.5.**Sample Run**

Population after 1 year: 3.148125827032967E8

Population after 2 years: 3.1759267940659344E8

Population after 3 years: 3.2037277610989016E8

Population after 4 years: 3.2315287281318676E8

Population after 5 years: 3.259329695164835E8

Class Name: Exercise01_11

Tagged in

Engineering

Computer Science

Find answers to questions asked by students like you.

Q: What are the responsibilities of the technology office of a firm's information systems (IS) departme...

A: Responsibilities of technology office:The responsibility of technology office includes the following...

Q: Hi I am coding with java. I am given the instructions: Create an array of 100 integers using a rand...

A: java program to randomly generate 100 integer number.Random class is used for generating 100 integer...

Q: What are the risks and benefits of outsourcing an information security program? What is a work break...

A: We are authorized to answer one question at a time, since you have not mentioned which question you ...

Q: Write a buble sort program to sort any number of complex numbers in an order such that their imagina...

A: Definition:Bubble sort - The adjacent elements are compared and swapped if elements are in the wrong...

Q: How does changing the number of threads (-n) change the outcome of theprogram? Are there any values ...

A: To change outcome of the program:The user can dynamically change the number of threads in a program....

Q: Express 1/16 in IEEE 32-bit floating-point format.

A: In the 32-bit IEEE format, the first bit is sign bit, the next 8 bits are assigned as the biased exp...

Q: Consider a schema R={A,B,C,D,E} and the following set of functional dependencies: {AB-> C, C->...

A: To find whether the relation is in BCNF or not, it must fulfill all the conditions given below-1)Rel...

Q: Write a program in python w/ no imports that the owner of Chica Chic could use to store data about h...

A: Open a file called inventory.txtThe file inventory.txt has the name of an inventory, cost, and quant...

Q: Version 5 templates allow customization of most certificate settings and permit autoenrollment. Grou...

A: Version 5 template: Version 5 template is used as a security protocol to authenticate users and serv...