Last active
September 3, 2016 17:04
-
-
Save kilon/8c43f3fc83856f27e03ddc6814a25f69 to your computer and use it in GitHub Desktop.
Compute the lines of code per day with a 12% increase each year to reach a total of 1 million lines of code, starting with 10 lines of code per day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y := 10. | |
Transcript clear. | |
Transcript show: '****************************';cr; | |
show: '* BEGIN COMPUTATION *';cr; | |
show: '****************************';cr. | |
(1 to: 30 ) do: [ :time| | |
Transcript show:'On year ';show:(time asString );show: ' '. | |
Transcript show: 'you code ' ;show: ((y*(1.12**time)) rounded)asString ; | |
show:' lines of code per day.';cr]. | |
x := 3650. | |
(1 to: 30 ) do: [ :time| | |
x := (3650* (1.12**time))+x ]. | |
Transcript show: '=============================';cr; | |
show: 'Total lines of code: ';show: (x rounded )asString;cr; | |
show: '============================='. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment