Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Mexico;
- const
- x0 = 58000000;
- xf = 100000000;
- t0 = 1994;
- rate = 0.07;
- function expPop(t: Real): Longint;
- begin
- expPop := Round(x0 * Exp( t * Ln( 1 + rate ) ));
- end;
- var
- x: Longint;
- t: Longint;
- tf: Real;
- begin
- t := 0;
- x := x0;
- repeat
- Writeln('Year: ', (t + t0), '; Population: ', x);
- t := t + 1;
- x := expPop(t);
- until x >= xf;
- tf := ( Ln(xf) - Ln(x0) ) / Ln ( 1 + rate);
- x := expPop(tf);
- Writeln('Year: ', (tf + t0), '; Population: ', x);
- Readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement