Unit 4- Variables Conditionals, and Functions Flashcards
Expression:
-a combination of operators and values that evaluates to a single value
Alternate Definition:
A programming statement
that can consist of a value, a variable, an operator, or a procedure call that returns a value.
What do expressions always do?
Evaluate/return to a single value!
What symbol is an assignment operator?
=
Assignment operator definition
allows a program to change the value represented by a variable
Arithmetic operator:
part of most programming languages and include addition, subtraction, multiplication,
division, and modulus operators (Which we haven’t learned yet)
Variable:
a named reference to a value that can be used repeatedly throughout a program.
Boolean Value:
a data type that is either true or false.
Comparison Operators:
<, >, <=, >=, ==, != indicate a Boolean expression
Function (Procedure)
a named group of programming instructions.
- Function Call
a command that executes the code within a function
Boolean Expression:
evaluates to either true or false
Concatenation:
joins together two or more strings end-to-end to make a new string.
Conditional Statement:
affect the sequential flow of control by executing different statements based on the value
of a Boolean expression.
Evaluate:
Expressions are evaluated to produce a single value.
Logical operator:
NOT !, AND &&, and OR ||, which evaluate to a Boolean value.
Relational operator:
used to test the relationship between two variables, expressions, or values. A comparison
using a relational operator evaluates to a Boolean value. For example: =, ≠, >, <, ≥, and ≤
-THE SAME AS A COMPARISON OPERATOR
Selection:
determines which parts of an algorithm are executed based on a condition being true or false
String:
an ordered sequence of characters.
What does getText/getNumber do?
Usually used in an onevent, gets input data from a specified UI element
What does a concatenation operator do?
Combines multiple strings into one
What does a \n new line operator do?
creates a new line of text
what is an assignment operator
(=) Gets the value of a variable, and changes the value of a variable in a program
Comparision operator
evaluates whether an expression setting 2 variales equal to each other is true or false (boolean, ==)
What is an if-else statement?
a conditional garunteed exactly 1 of 2 instructions of code will execute