Computer Science is taught by Mrs. Taricco. In this class, we learn about HTML, CSS, and Java. Our first major project in this class was the Personal Website that you're reading this on right now. Beyond this project, we also do many labs in order to deepen our understanding of Java.
The Sieve of Eratosthenes is an algorithm for finding all prime numbers up to a given limit. The algorithm works by iteratively marking the multiples of each prime starting from 2. For each unmarked number (which is a prime), it marks all of its multiples as composite (not prime). This process is repeated until all numbers have been processed. The algorithm starts with creating a boolean array with a length the upper limit. Then, all the elements from index 2 onwards will be set to true. After that, a loop will go through each value in the array and if the value is true, the program eliminates all the multiples of that value. The program continues the loop until the square root of the upper limit since it is redundant to check for more than that. Finally, for all the elements that remain true in the array, the program prints the index value which give the primes from 2 up to the upper limit.
The algorithm involves summing every other digit from the rightmost side, then doubling the digits not included in the initial sum and adding their resulting numbers. The final step is to combine the sums of these two steps. If the last digit of the result is 0, the credit card number is considered valid. If the last digit is not 0, the algorithm gives a number that can be changed in the ones place to make the card valid. This was created to practice iteration and validate credit cards.
Credit Card Validator
During our ArrayLists unit, we created an algorithm to simulate Bulgarian Solitaire. The game starts off with picking a triangular number of cards which are spread into a random number of piles with a random number of cards in each pile. Every "turn," one card is taken from each pile and added to a new pile at the end. This process continues until the size of the piles go from 1 through the level of the triangular number.
Music transposition is moving notes up or down a certain number of pitches. This can be used to transpose musical pieces to different keys (like from A major to E minor) or translate music from one instrument to another (like from a violin to a clarinet). Many musicians find music written for another instrument they want to play, and many music teachers like to transpose music into another key to make the piece easier for students. Unfortunately, all the software that accommodates this need is very expensive and requires monthly subscriptions. Another problem is that even after purchasing the required software, the amount of options and customization is overwhelming for casual users. Our product makes the music transposition process free and simple to use. We have an app that has only the most vital options and is free. This ensures that musicians and teachers who want to transpose music don't have to spend money or spend hours figuring out the minutiae of the software to be able to effectively use the product to transpose music.
This app is targeted toward musicians who want to convert music between different instruments and keys. Specifically, this app could be useful for younger musicians who do not understand enough music theory to transpose pieces manually. Teachers could use this app to transpose music to different instruments, enabling multiple sections in an ensemble to practice the same thing. It is usually a hassle to transpose the music by hand since there are a lot of instruments, and the musical pieces are usually long and complicated. Our app also targets individuals who are exploring or learning music on their own. A lot of music is composed in one key/instrument or the free version is only available in one key instrument. Students who are interested in exploring can use this app to transpose the music to the instrument they are playing instead of spending time and money trying to find the music that matches their instrument.
Our app uses two main algorithms to execute the intended actions. The first program is called audiveris and it is an open source Optical Music Recognition (OMR) software. The OMR software was heavily integrated into its User Interface, so it was a great challenge to seperate these two pieces. The audiveris software was used for the image processing and outputed a .mxl file which is a zipped version of the .musicXML file. These files, along with .midi files, are the industry standard for digital music scores. The other algorithm used in this app is our own transposition algorithm. This algorithm was used to transpose notes from key to key or instrument to instrument. Once audivers creates a .musicXML file, our transposition algorithm parses throught the file and changes all the existing notes to the key/instrument that the user wants.