Computer Science

What is it about?

Computer science is one of my favorite classes because I enjoy coding. In this class, we explore a variety of topics that aren’t typically covered in an average CS course. We start with Java, where we learn concepts such as data types, arithmetic, conditional statements, loops, and arrays. We also work on AP CSA problems to help us prepare for the AP exam. In addition to programming games and creating art, we also learn how to code in HTML and CSS. This is especially useful since we create our own websites, like the one you see here! At the end of the year, we participate in a project called Apps for Good, where we collaborate to create an app that benefits others. Computer Science class is incredibly fun, and I’ve learned a lot about problem-solving, critical thinking, and programming.

Stars Program

The Stars program was one of the most challenging projects I’ve worked on in CS class. The task was to generate 10 random stars with varying sizes, colors, and positions every time the program was run. To achieve this, I used a Java applet and imported the Random class to introduce randomness into the star’s properties. I created two static arrays to represent the x and y coordinates of each star's points. It’s important to note that each star consists of two circles: one for the inner points and another for the outer points. To draw these, I used two for-loops—one for each circle. I configured each of the 10 elements in both arrays by adjusting the angle and radius of the circles, which allowed the stars to be positioned randomly. I also made the colors random for each of the 10 stars. A sample output can be seen in the PDF to the left. Although this program was very challenging, it was also a lot of fun to complete.

Rock Paper Scissors Program

Everyone loves playing the popular game of rock-paper-scissors, and coding it was just as easy as playing it. The main requirement was understanding how to use conditional statements. For this program, I set it up so the user would play against the computer, which is represented by a random integer generated by the program. As shown in the “System.out.println” statement, I assigned integers to each of the three options. The computer then randomly selects an option by generating the corresponding number. Next, I wrote several if and else-if statements to account for every possible scenario in rock-paper-scissors. Three sample outputs can be found in the PDF. This program was easy to code, and playing it never gets old.