My teacher for Computer Science is Ms. Tarrico. We started the year by learning HTML and CSS and designing our websites. After this, we moved to learning the basics of Java through smaller assignments and larger labs. For each topic, we were given a document to take notes on, and at the end of the document, there were small assignments to practice the topic. We are often given lab assignments, which take longer and involve multiple steps. These labs are an opportunity to demonstrate our skills.
One of the first projects we worked on was programming a computer to play rock paper scissors. This involved using the scanner class and the random class. In addition, this program helped us use if else statements. The program first asks the user for either “rock”, “paper”, or “scissors” and then assigns the player a 1, 2, or 3 depending on what was chosen. The computer randomly generates a number between 1 and 3, and if the human’s number is bigger, except for 3, the human wins.
The Sieve of Eratosthenes is a numerical system to find primes. You start with an array of numbers and starting with the number 2, cross off every number divisible by 2. Take the next number, in this case 3, and cross off every number divisible by 3. Keep going until you reach the square root of the upper bound of numbers you would like to find the primes under. For this program, we had to automate the Sieve to find prime numbers under a certain number n. This was practice for our for loops, of where we had to figure out where to start and stop the for loop.