MTEL Digital Literacy and Computer Science - Question List

Select how would you like to study

76.
For which of the following purposes is the concatenation operator + used?
  1. Adding two decimal numbers.
  2. Changing a single-digit integer into a single character.
  3. Rounding a decimal number to the nearest whole number.
  4. Joining two strings to make a larger string.
77.
In which of the following situations is it more appropriate to use a while loop than a for loop?
  1. The number of times a loop will execute is not known in advance.
  2. The loop is called from within a procedure.
  3. The number of statements in the loop body is greater than 10.
  4. The loop continues until a condition is satisfied.
78.
Use the pseudocode below to answer the question that follows.
1
      function calc_score(suit, value)
2             score = 0
3
4             if (suit is "heart" OR suit is "red")
5                    score = 2 * value
6             else
7                    score = value
8
9       return score
10
11     #main body of program
12
13    score = calc_score("heart", 4)
14    print(score)

Which line in the segment of pseudocode illustrates the passing of arguments?
  1. Line 1
  2. Line 2
  3. Line 9
  4. Line 13
79.
In an array data type, the index is used for which of the following purposes?
  1. Identifying the size of the array.
  2. Locating elements within the array
  3. Defining the first value in the array.
  4. Identifying duplicate data in the array.
80.
Use the pseudocode below to answer the question that follows.
1
 # the index of list_one begins at 0
2
3   list_one = ["March", "April", "May", "June", "July"]
4
5   # execute selected code here
6   print(list_one[i])

A student wants to print out the elements in
list_one. Which of the following replacements for # execute selected code here on line 5 is correct?
  1. for (i = 0; i < 4; i = i + 1)
  2. for (i = 0; i <= 4; i = i + 1)
  3. for (i = 1; i < 5; i = i + 1)
  4. for (i = 1; i <= 5; i = i + 1)

Select how would you like to study