Computer Science

Class Description

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.

Sieve of Eratosthenes

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

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.

Apps For Good

Apps For Good is a group project we all do at the end of the year where we are assigned groups and have to make an app that addresses an issue. My group chose to make an app aimed towards college kids. One significant issue that college kids face is not knowing what to eat. It is most of their first times out of the house and most have little to no cooking experience. We aimed to create an app where college kids could connect and post recipes, our MVP, for each other. These recipes could have no more than 5 ingredients for simplicity.

To allow users to get started and not having to be the first to post, we supplied some starter recipes for the users. All of these recipes, which include duration, ingredients, amount, and a description, are stored using Firebase. To go with this, a search algorithm was implemented so that users could search for something they wanted to eat but do not necessarily know how to make.

Our app has a home page with a search bar at the top with the home page listing all recipes. There is also an upload page which has all of the fields the user needs to fill out and displays an error if they don't meet the criteria.

Apps For Good Poster

Apps For Good Poster