This class is taught by Ms. Taricco and focuses on Java and various aspects of coding. We started off by learning how to code in HTML and CSS; this is how you are able to see my website! Throughout A and B terms, we worked on various Java projects such as calculating a user's salary, validating a credit card number, and playing “Guess my number” with the user. Soon, we will create a social-good app as our next project. For the students who have already completed AP Computer Science from their sending school, they get to work on an independent CS project.
The code below is the first code I've written in Java. This was the first Java unit we learned in class. This assignment taught us the basics of print statements (System.print.ln(“String”);), and how a backslash (\) needs to be written twice (\\) for the code to print a backslash. The code below simply puts a bunch of print statements together to print a cute giraffe saying hello in a few different languages. Here is a pdf of my Animal Code.
Throughout the year, we covered more Java topics. Here is another assignment from the class. We had to write some code that could play “Guess my number” with the user. The user would input a number between 1 and 100; the computer would tell the user if their number was too high or too low. The user could keep on playing until they guessed the correct number that the computer generated. If you want, you can run this code on your computer to test it out! Here is the pdf version of my code: Guess my number.
Budgeting has always been an issue when it comes to grocery shopping, and oftentimes, people compensate for low budgets by cutting down on grocery expenses. However, cutting down on grocery expenses can lead to scrappy, insufficient diets. Stores tend to incentivize users to purchase a membership to save a certain amount of money every time the user shops at their store. However, are those memberships worth buying? Can these memberships save money for the user?
1. The average American consumers who are looking to save money
2. People considering a Costco membership
3. People who own a Costco membership and wondering if the membership is worth the money they are paying
4. People who need help budgeting their weekly food expenses
We created an app that can determine if a membership is "worth it" for the user. Currently, it only outputs the worth of a Costco membership, but the app can be expanded to calculate the worth of memberships from different stores as well.
1. The application can determine the closest superstore to a user based on their location
2. The application can determine a membership’s effectiveness for a user based on their lifestyle (e.g. their number of meals per day, frequency of grocery store visits, price allocated for food) in the form of a “yes” or “no”. This will be through a model that quantifies membership effectiveness based on the categories listed above.
3. The app will output the statistics of the model after determining membership effectiveness for the user
After we decided on creating an app to solve the "worthiness"of a membership, we realized we needed to do some background research to fully understand the scope of the project. Everyone looked online for existing apps that could calculate the “worthiness” of a membership, yet there were barely any apps with the functions we were looking for. After gaining a good look at the existing apps in the market, we started thinking about the design.
For the design, we realized we needed to create a mathematical algorithm to actually output an answer. Our team then split in half. Two people worked on creating the algorithm, and two people used Android Studio to create the front end (or what the user sees) of the app. Our team decided to use Android Studio, the official IDE for developing Android apps, as the main app to help us create and develop our app. Many of us had to learn to use Android Studio and write in Java, Kotlin, and XML. Four pages were needed to create the final app. Each person took one page. We shared all our code on GitHub to ensure everyone had roughly the same code.
In terms of implementing the design, we just coded the mathematical model into a button. The user can input their data, and the mathematical model will use the data and calculate the amount of money saved or lost if the user gets a Costco membership. This number would be returned to the user to show them how much money they would be losing or gaining. To test this model, we ran a bunch of random values in each variable to ensure it would always return a number. To test the app itself, we made sure all the buttons led to a page. We made sure there were no hanging pages and that everything was ultimately tied to the home page.