MIT app inventor
STM GPA Calculator
Matt and I teamed up to invent an all-purpose STM GPA calculator. The student can calculate their gpa, find out what's for lunch, access their edline and e-mail account all from our app. To find out one's gpa simply choose your class intensities and the grades you currently have in your classes. Then, press calculate and let the app do the math. Your gpa will appear and there you go! If you are wondering what is for lunch or if someone e-mailed you or if a teacher updated edline just click the corresponding button. It's a simple app that can be used by any student at St. Thomas More. The process of making this app has taught me how to code a button to open a link on the internet. It has also taught me how simple tasks may be hard to code. You do not realize how long something as simple as a gpa calculator can take. Somethings don't work and it is a lot of trial and error.
The first step to coding is initializing your variables. We set all the sliders to 0 and set values to the letter grade. The code of the buttons that I talked about before are also shown in this screenshot. In order for the webpage to pop up you need to set the Activity starter DataUrl to the link of the webpage. Then you have to make the activity action set to view the webpage. If you do not set it to view, the webpage will not show. IN order for it to show you also need to call it, which is the purple block.
|
Class Sliders |
Grade Sliders |
Math & Reset |
For the spinners that the user selects class intensity, you have to code which each selection does. When selecting a regular class it adds 0 to the global s(spinner number)- in this case 5. If it is honors or AP it adds one to the corresponding global s(spinner number). If study hall is selected it adds 1 to one variable and 0 to another.
|
This part was are most redundant hands down. This code is very similar to the class sliders. Most of it is "if...then" statements. Basically, it takes the grade (which we assigned values too already) and sets that slider value to that grades number value.
|
The math and reset was probably the most difficult part to code for the app. It took many trial and errors. Eventually we came up with a code that worked! Thank Gosh... I thought that it would be the death of me. We made the app add all the sliders together and subtract the number of study halls from the number of classes. Then, we divided the total by the total number of classes. For the app to reset and work again, we set all the sliders to "Select Grade" and all the values back to 0.
|