Procedural Abstraction, discussion on code and abstraction techniques used: Frontend/Backend, Functions, Classes, etc

  • The program allows for the user to input an activity that they participated in. The list of activities are easily updated with the frontend page, so that it can allow all of the users to see new activities that have been added.
  • The users are offered 3 boxes that are used to input their information about the activity like the name of the activity, the address of the activity, and their rating of the activity. Once all 3 boxes are filled out the user clicks the “add” button, which then allows their information to be displayed into the table on the site.
  • The initial call verifies if the response status is 200, in which case the information from the database won't be displayed on the frontend.
  • The subsequent call verifies if the information obtained from the database is correct and readable, and if so, it's displayed on the frontend as a result.

Data Abstraction, discussion on data used and data structures to support project: JSON, Dictionaries, Lists, and/or Database Tables.

  • An SQLite Database was used, and within the Database, there was a table that contained all of the data that was being collected about each of the activities. The name of the class, which is “ActivityDay”, has the table called “ActivityTime” inside of it.
  • The data inside the table of SQLite Database represents all the activities and the associated information with them. This includes the activity name, the address of the activity, and the level of fun.
  • The table named “ActivityTime” manages complexity because when the user inputs information about an activity the frontend is automatically updated. If I were to use a list it would be a lot worse because you would have to automatically update it, but with an SQLite Database it allows for automatic updates.
  • The first call is checking if the error response status is equivalent to 200 or not.
  • The second call is verifying if there is any readable information available in the SQLite Database and if it can be presented on the frontend in a user-friendly format.

Usage of Control Structures, ie Iteration and Conditional Statements. Areas where you use lists and interation in Frontend Display. Areas were you decide and execulte different paths of code, for instance Create vs Read vs Update vs Delete. Also, show a function where a different parameter or condition causes a differen result.

  • The function involved is called "read_users()", and it enables the frontend of the site to display the activities and their corresponding identifiers stored in the database's table. The function takes in a parameter called "read_options", which is retrieved using the code snippet provided above. The information retrieved from the database is formatted as JSON and presented in a readable manner on the site's frontend.
  • The fetching algorithm includes a constant called "errorMsg" that is printed to the console if certain error conditions are met. The algorithm uses the JavaScript Fetch feature to obtain the required data from the API, and an if-statement is used to filter response errors by checking if the response status is 200. If the status is not 200, iteration is used to search for matching row data in the SQLite Database Table "ActivityTime". The order of the steps in this function is crucial. When a match is found, the data is displayed in a readable JSON format on the frontend site for all users to see.
  • The outcome of the first call is that any invalid data won't be displayed on the frontend of the website for users to read.
  • The result of the second call is that all valid data is added to the frontend table, and it's presented in a readable manner for all users of the website feature.