Which of the following is an example of a character variable?
‘7’
Explanation
A character variable stores a single character, like ‘7’.
3.14 is a floating-point number.
“555-1212” is a string.
False is a Boolean value.
Related Content
10.3.2 Variable Types
10.3.4 Characters and Text
10.3.5 Encoding Characters
What is a variable in a computer program?
A container that holds data for use later
Explanation
A variable acts like a container that holds different types of data such as numbers, words, and phrases for use later in the program.
This is essential for storing data that can change during the execution of a program.
A fixed value that never changes is a constant.
A type of function that performs calculations is not a variable.
A special type of loop in programming is not a variable.
Related Content
10.3.1 What is a Variable in Program Code?
10.3.2 Variable Types
Which of the following is an example of an integer?
23
Explanation
An integer is a whole number without a fraction or decimal place, like 23.
4.1 is a floating-point number because it has a decimal fraction.
5.62 is also a floating-point number.
9.95 is a floating-point number.
Related Content
10.3.2 Variable Types
10.3.3 Number Types
What is a floating-point number?
A number that can have decimal fractions
Explanation
A floating-point number can have decimal fractions, like 4.1 or 5.62.
Whole numbers are integers.
A number with a specific number of digits after the decimal point describes fixed-point numbers.
A number used only in financial calculations indicates a fixed-point or floating-point numbers.
However, floating point are not limited to financial calculations.
Related Content
10.3.2 Variable Types
10.3.3 Number Types
Which of the following is an example of a string?
Hello world
Explanation
Hello world is a collection of characters, making it a string.
7 is an integer.
The $ is a single character.
The @ is also a single character.
Related Content
10.3.2 Variable Types
10.3.4 Characters and Text
10.3.5 Encoding Characters
What happens when you enter a number as a character?
You cannot perform math operations with it.
Explanation
When a number is entered as a character, you cannot perform math operations with it.
You cannot perform math operations with a number entered as a character.
It remains a character, not a string.
The character does not get deleted.
Related Content
10.3.2 Variable Types
10.3.4 Characters and Text
10.3.5 Encoding Characters
In pseudocode, what does the symbol || represent?
Logical OR
Explanation
The symbol || represents Logical OR in pseudocode.
&& represents Logical AND.
^ represents Logical XOR.
! represents Logical NOT.
Related Content
10.3.1 What is a Variable in Program Code?
10.3.2 Variable Types
10.3.6 Booleans and Logic
Which Boolean operation returns True only if both conditions are True?
AND
Explanation
The AND operation returns True only if both conditions are True.
OR returns True if either condition is True.
XOR returns True if one condition is True and the other is False.
NOT inverts the condition, so it returns True if the condition is False.
Related Content
10.3.1 What is a Variable in Program Code?
10.3.2 Variable Types
10.3.6 Booleans and Logic
What does it mean for an array to be multidimensional?
It can hold arrays within arrays.
Explanation
Multidimensional arrays can hold arrays within arrays.
Multidimensional arrays hold multiple values, not just one.
Multidimensional arrays can be used in more than one dimension.
Arrays are not functions.
Related Content
10.3.2 Variable Types
10.3.7 Arrays
10.4.7 Code Visualizer Lab: For Loop with Array
What is an array?
A special type of variable that holds many values at once
Explanation
An array is indeed a special type of variable that can hold multiple values at once.
A loop is a control structure that repeats a block of code.
A single value variable holds only one value, not many.
A function is a block of code designed to perform a particular task.
Related Content
10.3.2 Variable Types
10.3.7 Arrays
10.4.7 Code Visualizer Lab: For Loop with Array