Answer the following 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
Answer
The meaning of these statements is that the program is supposed to take the current value of global x, the variable, and add one to it. For example, if global x was 4, then it would be 5 after running this program.
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.
Answer
The use of this variable helps reduce details to focus on what’s relevant by making the code easier to understand. The programmer now knows that the variable is some value, not a certain one, and does not have to focus on what that value is. It also helps represent what the value is(i.e. dotsize).