Last active
April 27, 2023 07:03
-
-
Save dengsauve/edfe8a3baf6a616182fc3892eeeb76aa to your computer and use it in GitHub Desktop.
saveRic'sButt
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
import kotlin.random.Random | |
/************************************************************ | |
* Name: Eric Gooler | |
* Date: 4/26/2023 | |
* Assignment: | |
* Class Number: CIS282 | |
* Description: | |
************************************************************/ | |
fun main() { | |
var numbers = List(200) { Random.nextInt(1, 101) } | |
println("Range # Found Chart\n-------- ---------- -------------------------------------------") | |
for (i in 0..9) { | |
var count = 0 | |
for (number in numbers) { if ((number / 10) == i) { count++ } } | |
// repeat for each range of numbers | |
print("${i * 10 + 1} - ${i + 1}0 \t\t| $count | " + "*".repeat(count) + "\n") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment