3.2 Paint Pot Tutorial Curriculum Page
Portfolio Reflection Questions:
1. Explain the meaning of the statements shown here, both in AP CSP pseudocode and App Inventor. For example, suppose the variable X has the value 10 before the statement is executed. What value would it have after the statement is executed.
X ← X + 1
- The statement above means that the current value of X is going to be set, or changed to its original value plus one. So, since the directions explain that the value of X is ten, the new value of X will be eleven. This answer is found by doing (10 + 1), which results in the value 11.
2. One aspect of abstraction is that it helps to reduce details to focus on what's relevant. How does the use of a variable, such as dotsize, instead of a value, such as '5', help to reduce detail and focus on what is essential in this program.
- The use of a variable instead of a value helps to reduce detail and focus on what's essential in the program because it enables the programmer to expand the possibilities of statements that could be used. So for example, if the variable "dotsize" is used instead of the value 5, the variable can be set to many different values that can be changed through statements, and by the user's actions. However, if the value 5 was used, the statements used will be based around the number 5. So all in all, it opens up the possibilities by creating a more general statement that enable the values to change more easily.