The Computer Science class here at Mass Academy closely follows the AP CSA curriculum by the College Board. We started the year coding in HTML and CSS to make our websites, but moved on to Java and started doing various exercises to teach us certain things we can do with Java.
The Sieve of Eratosthenes is a program we coded that tells you all of the prime numbers that are between 0 and your input upper bound. For the output we had to limit it to 16 numbers per line, so that required the use of modular arithmetic. This was also one of our first assignments using static arrays.
Bulgarian Solitare is a game where you start with multiple piles of cards where the total number of cards adds up to a triangular number. Triangular numbers are numbers such as 1, 3, 6, 10, 15, etc. The goal of the game is to get the piles into piles of 1, 2, 3, 4, etc. You take one card from each pile and move it to the end making a new pile. No matter the triangular number you start with or the original piles, it will always end up in a sequence of 1, 2, 3... until they add up to your number. What this code does is simulate this game based on user input piles. It will tell you if your number isn't triangular, and if it is, it will tell you the end piles and how many steps it took to get there.