Question

In: Computer Science

The population growth for Norway is: 1 birth every 1 minutes and 40 seconds 1 death...

The population growth for Norway is:

1 birth every 1 minutes and 40 seconds

1 death every 3 minutes and 16 seconds

1 arrival every 57 seconds

1 departure every 1 minute and 49 seconds

Assume the current population is 35,201,142. Write a program that calculates the population n minutes from now. Declare a final integer called minutesElapsed and perform your calculations based on that

Solutions

Expert Solution

/*******************************CurrentPopulation.java*****************************/

public class CurrentPopulation {

   public static void main(String[] args) {

       final int minutesElapsed = 140;
       final int BIRTH_TIME = 100; // birth in second
       final int DEATH_TIME = 196; // death in second
       final int ARRIVAL_TIME = 57; // Arrival in second
       final int DEPARTURE_TIME = 109; // departure in second
       int currentPopulation = 35201142; // current population

       int secondElapsed = minutesElapsed * 60; // elapsed time in second

       int birth = secondElapsed / BIRTH_TIME;// calculate births
       int death = secondElapsed / DEATH_TIME; // calculate deaths
       int arrival = secondElapsed / ARRIVAL_TIME; // calculate arrivals
       int departure = secondElapsed / DEPARTURE_TIME; // calculate departures

       currentPopulation = currentPopulation + birth - death + arrival - departure;

       System.out
               .println("Current Population of Norway after " + minutesElapsed + " Minutes is: " + currentPopulation);
   }
}
/***************************************output************************************/

Current Population of Norway after 140 Minutes is: 35201254

Please let me know if you have any doubt or modify the answer, Thanks :)


Related Solutions

In Norway, the distribution of birth weights for full-term infants whose gestational age is 40 weeks...
In Norway, the distribution of birth weights for full-term infants whose gestational age is 40 weeks is approximately normal with mean μ= 3500 grams. We wish to determine if the birth weights of full-term babies whose mothers smoked throughout pregnancy is less than those of non-smoking mothers. A sample of 17 babies born to mothers who smoked is collected. The sample mean is 3297 grams and the sample standard deviation is 430 grams. Test your hypothesis at the α =...
Transient Population Populations are effected by the birth and death rate, as well as the number...
Transient Population Populations are effected by the birth and death rate, as well as the number of people who move in and out each year. The birth rate is the percentage increase of the population due to births and the death rate is the percentage decrease of the population due to deaths. Write a program that displays the size of a population for any number of years. The program should ask for the following data: The starting size of a...
Crude Birth Number of Births Estimated midyear population Crude Death Number of Deaths Estimated midyear population...
Crude Birth Number of Births Estimated midyear population Crude Death Number of Deaths Estimated midyear population Crude Divorce Number of Divorces Estimated midyear population Crude Marriage Number of Marriages Estimated midyear population Fetal Death Number of Fetal Deaths (20+Wks Gestation) Number of Live Births + Fetal Deaths Fertility Number of Live Births Estimated midyear female population age 15–44 Infant Mortality Number of Infant Deaths Number of Live Births Neonatal Number of deaths < 28 days Mortality Number of Live births...
Crude Birth Number of Births Estimated midyear population Crude Death Number of Deaths Estimated midyear population...
Crude Birth Number of Births Estimated midyear population Crude Death Number of Deaths Estimated midyear population Crude Divorce Number of Divorces Estimated midyear population Crude Marriage Number of Marriages Estimated midyear population Fetal Death Number of Fetal Deaths (20+Wks Gestation) Number of Live Births + Fetal Deaths Fertility Number of Live Births Estimated midyear female population age 15–44 Infant Mortality Number of Infant Deaths Number of Live Births Neonatal Number of deaths < 28 days Mortality Number of Live births...
In a population of students, 60% study for every homework assignment. A sample of 40 students...
In a population of students, 60% study for every homework assignment. A sample of 40 students from this population is taken, and the number who study for every homework assignment from this sample is recorded as the random variable X. a) (4 pts) Verify that X has a binomial distribution. b) (4 pts) Find the probability that exactly 25 students from the sample study for the exam. c) (4 pts) Find the mean for this binomial experiment
A bank teller can handle 40 customers an hour and customers arrive every six minutes. What...
A bank teller can handle 40 customers an hour and customers arrive every six minutes. What is the average time a customer spends waiting in line? a. 15 seconds b. 0.40 minutes c. 1.25 minutes d. 30 seconds Customers arrive at a bakery at an average rate of 18 per hour on week day mornings. Each clerk can serve a customer in an average of three minutes. How long does each customer wait in the system? a. 1 hour b....
1.It takes light 8 minutes and 20 seconds to reach the Earth from the Sun. The...
1.It takes light 8 minutes and 20 seconds to reach the Earth from the Sun. The speed of light in a vacuum is a constant at 3×108??. Assume Earth’s orbit is circular.a.Whatis the distance from the Sun to the Earth?b.Calculate the mass of the Sun 2.This past week SpaceX and NASA teamed up to launch two astronauts to theInternational Space Station (ISS)from Cape Canaveral for the first time since 2011.The ISShas a mass of4.08×105??and orbits the Earth on acircular path...
Latinos comprise almost 40 percent of the population in Texas. Observers note that the growth of...
Latinos comprise almost 40 percent of the population in Texas. Observers note that the growth of the Latino population outpaces the growth of the Anglo and African American populations. Of course, this is just one of many demographic trends Texas is experiencing. What are the political implications of these trends? How might this trend affect voting patterns or one-party dominance?
1. Every two seconds someone in America needs blood. It is important that hospitals have the...
1. Every two seconds someone in America needs blood. It is important that hospitals have the right types of quality blood to meet the patient needs. Blood donation centers help hospitals meet this demand. There are four main blood groups: A, B, AB, and O, of which O is the most common. One of the less common blood types is B+. In the United States, only 9% of the population has B+ blood type. Assume that 5 donors arrive to...
Question: A robot is given 1 random instruction every second for 10 seconds. Each instruction will...
Question: A robot is given 1 random instruction every second for 10 seconds. Each instruction will be either a command to move 1 inch to the left, or 1 inch to the right. The likelihoods of the instruction being a command to move to the left and right are 'p' and '1-p', respectively. Find: a) What is the expectation of the robot's final position with respect to its starting position. b) What is the variance we might expect for observations...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT