Benjamin Chase

-> An application that helps to create valid high school class schedules.

User Story

Stephen Decatur High School and Worcester Technical High School are looking for an easy way to do high school course scheduling for students. They need an application that students can use to find a possible schedule for their classes. Students will input classes they have previously taken along with the classes they desire. Then, the app will show them multiple possible schedules for their upcoming high school years. The program will check that all prerequisites and requirements are fulfilled using a custom defined procedure and conditional logic.

Backlog Items

List of iteration tasks:
1. Create design/layout using checkboxes, labels, dropdown menus, and buttons to provide an intuitive user interface.
2. Organize the data of all of the courses offered into a master file that is converted into a database.
3. Check if all requirements are met (4 english classes, 4 math classes, 3 social studies classes, 3 science classes, 1 fine arts class, 2 PE/Health classes, and 1 technology class)
4. Add lists of prerequisites for each class in the master data file.
5. Use a method that tries all possibilities for class schedules whether they work or do not work
6. Check if each possibility is a solution (all requirements are met and all prerequisites are met at least one semester before the class that needs the prerequisite)
7. Display the schedule solutions that work.

Demonstration of the App

The Code

For this project, I used MIT App Inventor.

To download the .aia app inventor file, click here to download all of the code.
Then import it into MIT App Inventor.

Reflection

* First, the user selects their next semester using the spinner/dropdown menu. This is handled in the "when Spinner1.AfterSelecting" event handler. Then, the selection is checked and the amount of classes left is assigned to a global variable "classesLeft"

* Second, users select their previous classes and future classes. This selection is handled using an event handler "when any CheckBox.changed"

* When the user presses the submit button, or "buttonSubmit", all the requirements for the classes are calculated and checked. Multiple local variables are initialized, such as "amountMath" for getting the amount of math classes that are in the schedule. If/Else conditinal statements use conditional logic to check if the schedule meets the requirements (such as having 4 Mathematics credits), and the procedure "call Notifier1.ShowMessageDialog" is used to display a dialog so the user knows what is wrong in the schedule if it does not meet the requirements (such as not having enough Fine Arts credits).

* A while loop is used to generate a new random schedule possibility, and conditional statements are used to ensure it is unique from other possibilities that have been previously tried.

* A LOT of conditional logic is used to check that all prerequisites are met in the possible solution. This includes:

-> Checking that the prerequisites are actually in the schedule

-> Ensuring that the prerequisites have already been taken OR that the prerequisites are taken at least 4 classes prior to when they are needed for another class. Making sure that the prerequisites are taken at least 4 classes prior to their need makes sure that they are not in the same semester as the next classes that need them.

-> The prerequisites must be met in order (For example, English 9, English 10, American Literature, AP English Literature, and not another order.)

* I also had to check that solutions were not rechecked if they were already checked. I made a list of tried solutions and used a conditional statement to see if the solution was in the list. If it was already in the list, I would generate a new random possibility, and repeat the conditional statement until a unique possibility was found.

* I had to limit the amount of solutions the program would try. I used some basic math to figure this out, which is (the amount of classes left)!. The ! means factorial. So if your next semester is your 10th grade spring semester, you have 20 classes left to take, meaning there are 20! or 2.4329020082×10^18 possibilities left where classes are not repeated. That is a lot! That is 2,432,902,008,200,000,000 possibilities!



I enjoyed making a useful app that helps students make a plan for high school. It was a fun challenge and I learned a lot about data management. But I will not leave it at that! I will reprogram it in python or another programming language so it runs faster and I can add more functionality such as checking whether you are at Stephen Decatur High School or Worcester Technical High School half of the day, or all of the day. I will also add the functionality of checking if a course is taught in only the fall semester, spring semester, or if it is taught in both semesters.