SDEV120 M05 Evaluate: Quiz
If MyNumber = 6.8, what is the value of Int(MyNumber * 4^2)?
108
If Number1 = 19.86 and Number2 = 2.94, what value results from the following statement? Int(Number1 + Number2)
22
Given: Count = 23, what is the value of Count after the following statement is executed: Count = Count + 2
25
If A = 5 and B = 3, what will be displayed when code corresponding to the following pseudocode is run? (In the answer options, new lines are separated by commas.) Do Write A^2 Set A = A - 1 While A >= B
25,16,9
If N = 5, what is displayed when the following pseudocode is coded and run? Set A = 2 For (B = 1; B <=N; B++) Set A = A + 2 * B End For Write A
32
What is the value of Number, given the following: A = 3.2, B = 6, C = 8 Set Number = Floor(A + C / B)
4
If Count = 1 and X = 3, what will be displayed when code corresponding to the following pseudocode is run? Do Set Y = Count + X Write Y Set Count = Count + 1 While Count <= X
4,5,6
If Number = 7, what will be displayed after code corresponding to the following pseudocode is run? (In the answer options, new lines are separated by semi-colons.) For (Count = 5; Count <= Number; Count++) Write Count + ", " + Count * 2 End For
5, 10; 6, 12; 7, 14
What is the value of Number, given the following: A = 2.3, B = 3.8 Set Number = Floor(Ceiling(A) + B)
6
Which of the following is not a type of loop? Do... While For While Repeat... Until All of these are types of loops
All of these are types of loops
If Apples = 6, what will be displayed after code corresponding to the following pseudocode is run? While Apples < 0 Write "You can't eat " + Apples + "at one time!" End While Write "Goodbye, apple lover."
Goodbye, apple lover.
If the increment of a For loop is negative, then the body of the loop will not be executed if the initial value is _______ than the limit value.
Less
What input can cause this loop to end? Declare Number, ComputerNumber As Integer Do Write "Please enter a number: " Input Number ComputerNumber = Number + 1 Write Number While Number <= ComputerNumber Write "The End"
Nothing would cause this loop to end; it is an infinite loop.
A ________ value in a loop can be either a positive or a negative number.
Step
To __________ data means to ensure that the data are in the proper range.
Validate
A variable that holds the accumulated result of a sum is called a(n) __________.
accumulator
For readability, most programs __________ the body of a loop.
indent
If a condition in a post-test loop can never be met, the loop is an _________ loop.
infinite
When a loop counter is set to its first value, it is said to be __________.
initialized