Term 3 Flashcards
What is a UI element
A UI element is an on-screen object e.g. buttons, images, labels, screens. Also known as widgets.
What is a User Interface (UI)?
A user interface is the layout/ visual elements of a program which the user interacts with.
What is an event?
An action that causes something to happen. e.g. a click
What is the event listener block of the code?
OnEvent block
What is an example of a callback function in code?
A click of a button changes the screen.
What is an event handling/ event handler?
A code segment (blocks of code)
What is a suitable ID for a pink button?
pinkBtn
What is a syntax error?
A syntax error is a spelling mistake within the program.
Give 2 examples of a syntax error
- A missing semicolon or bracket at the end of a line
2. Referring to an ID called “horseBtn” but you misspell it as “hoseBtn”
What is a logic error?
A logic error is when the program runs but it doesn’t do what you think it should.
Give 2 examples of a logic error
- Assigning a value to the wrong variable
2. “2+3” instead of 2+3
What is a global variable?
A variable that can be used through the whole program as it has been declared outside of the function.
Give an example of when a global variable would be used
When the coder wants to use the variable in more than one function. e.g. The coder would declare the variable such as “var count= 0” at the start of the code instead of in each function.
What is a local variable?
A local variable is a variable that is declared within one function and can only be used in the function of code.
What is a variable?
A variable is a lable for a peice of information used in the program.