e-shen2022 / APCS_Blog

Apache License 2.0
0 stars 10 forks source link

College Board Rubric #30

Open e-shen2022 opened 1 year ago

e-shen2022 commented 1 year ago

Row 1: Program Purpose & Function

Row 2: Data Abstraction

In the written response (3B):

Row 3: Managing Complexity

In the written response (3B):

Row 4: Procedural Abstraction

In the written response (3C):

Row 5: Algorithm Implementation

In the written response (3C):

1. Fetching Database & displaying on website Here I take the Javascript-generated skin product table and assign it to "result" id at the beginning of the file right after the column headers for the data table.

image

Now, I use document.getElementByID() to access the "result" id and assign it to "resultcontainer".

image

The last step is to write innerHTML to each "tr" element, then append all "tr"s to form each row, and all "tr" rows are appended to "td" to form the whole table. Finally, I append "td" to "resultcontainer" which displays on the website!

image

2. Taking user input & displaying output on the website Taking user input from HTML uses the same document.getElementById(""). By looking through "allSkinProducts" and comparing it with user input, we can find the skin product the user is looking for. Corner cases are also been handled.

image image

Here is the function where first I check if the user's skin type is equal to the data row's skin type, if so then I check if the user wanted product is a product type available in the database too. If either is not met the input, the error message will be reported as we do not offer this skin type/skin product recommendation.

image image

Row 6: Testing

1st call: Text shows "Skin type:" and user will type out their skin type. Text shows "Skin Product type" and user will type out what kind of skin care product they want to be recommended to them 2nd call: Text shows "Skin type:" and user will type out their skin type. Text shows "Skin Product type" and user will type out what kind of skin care product they want to be recommended to them

1st condition: if user types out "oily" for skin type and "moisturizer" for product type 2nd call: if user types out "dry" for skin type and "serum" for product type

1st result: Output "SkinCenuticals Moisturizer" 2nd call: Output "Simple Booster Serum"