Download or view army.frink in plain text format
/** This takes the number of people in all ranks of the U.S. Military
and turns their likelihood into a percentile score and frequency.
For each rank, the percentile score and frequency is the *bottom*
of the rank.
See:
https://www.factmonster.com/us/military/us-military-ranks
*/
ranks = [["E-1", "Private", "Seaman Recruit", "Recruit", 53586],
["E-2", "Army Private/Marine Private First Class", "Seaman Apprentice", "Airman", 80531],
["E-3", "Army Private First Class/Marine Lance Corporal", "Seaman", "Airman First Class", 185923],
["E-4", "Corporal", "Petty Officer, Third Class", "Senior Airman", 261890],
["E-5", "Sergeant", "Petty Officer, Second Class", "Staff Sergeant", 248805],
["E-6", "Staff Sergeant", "Petty Officer, First Class", "Technical Sergeant", 175234],
["E-7", "Army Sergeant First Class/Marine Gunnery Sergeant", "Chief Petty Officer", "Master Sergeant", 96956],
["E-8", "Master Sergeant", "Senior Chief Petty Officer", "Senior Master Sergeant", 26912],
["E-9", "Sergeant Major", "Master Chief Petty Officer", "Chief Master Sergeant", 10629],
["O-1","Second Lieutenant", "Ensign", "Second Lieutenant", 24579],
["O-2", "First Lieutenant", "Lieutenant Junior Grade", "First Lieutenant", 28002],
["O-3", "Captain", "Lieutenant", "Captain", 72729],
["O-4", "Major", "Lieutenant Commander", "Major", 45168],
["O-5", "Lieutenant Colonel", "Commander", "Lieutenant Colonel", 28148],
["O-6", "Colonel", "Captain", "Colonel", 11542],
["O-7", "Brigadier General", "Rear Admiral", "Brigadier General", 444],
["O-8", "Major General", "Rear Admiral", "Major General", 285],
["O-9", "Lieutenant General", "Vice Admiral", "Lieutenant General", 132],
["O-10", "General", "Admiral", "General", 39]]
sum = 0
for rank = ranks
{
rank.push[sum]
sum = sum + rank@4
}
table = new array
for rank = ranks
{
percentile = 1-((sum-rank@5)/sum) // Percentile
frequency = 1/((sum-rank@5)/sum) // Frequency
table.push[[rank@0, rank@1, rank@4, format[percentile, "percent" ,3], "1/" + format[frequency, 1, 3]]]
}
println[formatTable[table]]
Download or view army.frink in plain text format
This is a program written in the programming language Frink.
For more information, view the Frink
Documentation or see More Sample Frink Programs.
Alan Eliasen was born 20139 days, 6 hours, 1 minutes ago.