-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise01_11.java
More file actions
37 lines (34 loc) · 1.24 KB
/
Copy pathExercise01_11.java
File metadata and controls
37 lines (34 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package Chapter1;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author jorda
*/
public class Exercise01_11 {
public static void main(String[] args){
double yearlypopgrowth, secinyear, yearlybirths, yearlydeaths, yearlyimm;
int currentpop;
//yearlyimm = number of immagrants every year
//yearly* number of each stat in a year
secinyear = 60 * 60 * 24 * 365;
yearlybirths = secinyear / 7.0;
yearlydeaths = secinyear / 13.0;
yearlyimm = secinyear / 45.0;
yearlypopgrowth = yearlybirths + yearlyimm - yearlydeaths;
currentpop = 312032486;
currentpop = (int)(yearlypopgrowth + currentpop);
System.out.println(currentpop);
currentpop = (int)(yearlypopgrowth + currentpop);
System.out.println(currentpop);
currentpop = (int)(yearlypopgrowth + currentpop);
System.out.println(currentpop);
currentpop = (int)(yearlypopgrowth + currentpop);
System.out.println(currentpop);
currentpop = (int)(yearlypopgrowth + currentpop);
System.out.println(currentpop);
}
}