Beginner Projects
Prerequisites: Level 1 — Beginner
Build these on your own using what you learned in Level 1. Each one uses variables, strings, lists, maps, loops, methods, and closures.
1. Number Guessing Game
Pick a random number from 1 to 100 with new Random().nextInt(100) + 1,
read guesses with System.in.newReader().readLine(), say "higher" or
"lower", and count the attempts. Handle input that isn't a number with
isInteger().
2. To-Do List
Keep tasks in a list of maps ([title: ..., done: false]). Support commands
to add, complete, remove, and list tasks, printing them numbered with
eachWithIndex.
3. Word Frequency Counter
Read a paragraph, split it into words with tokenize, count them in a map,
and print the ten most common words, sorted by count.
4. Grade Book
Store students as maps with a name and a list of scores, compute each
average with sum() and size(), assign a letter grade with a switch
over ranges, and print an aligned report with padRight.
5. Unit Converter
Write methods that convert between Celsius and Fahrenheit, kilometers and
miles, and kilograms and pounds. Print a conversion table using ranges
and BigDecimal rounding.