1. For each of the 5 bugs in the Caesar Cipher app, explain what the bug was, how to fix it, and the type of error (semantic or syntax). If you wish, you can take a picture of your corrected blocks and then annotate it to identify and describe the bugs you fixed.
Answer
The first bug i found in the caesar cipher app was that the encrypt function resulted in the global variable plain alphabet instead of the local plaintext variable. To fix this, I simply dragged out the getter block for the alphabet variable and replaced it with a getter for the local plaintext variable. This was a semantic error. Another error i found was in the decrypt function, the loop in the procedure went up to 5, not the length of the cipher alphabet. To debug, I replaced the 5 with the length of the cipher alphabet. This was a semantic error as well. An additional bug I found was in the decrypt procedure- if the index = 0 should have been does not equal zero. To fix this semantic error, i simply selected the “does not equal” sign in the dropdown menu of the math block. Another semantic error i found was in the4 decrypt event handler, which set the text of the encrypt textbox instead of the decrypt one. To fix this, i simply changes the setter block to effect the cipher textbox instead of the plain text one.