In: Computer Science
1. In Object Oriented Programming The private object fields can
be directly manipulated by outside entities.
Group of answer choices
A. True
B. False
2. __________ programming is centered on the procedures or
actions that take place in a program.
Group of answer choices
A. Class
B. Object-oriented
C. Menu-driven
D. Procedural/ Structural
3. __________ programming encapsulates data and functions in an
object.
Group of answer choices
A. Object-oriented
B. Class
C. Menu-driven
D. Procedural
4. The data in an array can be sorted in either ascending or
descending order.
Group of answer choices
A. True
B. False
5. Which of the following statements is true after the following
statements are executed?
Set t = x
Set x = y
Set y = t
Group of answer choices:
A. y contains the value in x and x stayed the same
B. x contains the value in y and y stayed the same.
C. x and y contain their original values.
D. x and y have swapped their values.
6. Given the following statement, what is the subscript for the
data value 92?
Declare Integer numbers[5] = 83,92,78,94,61
Group of answer choices
A. 2
B. 0
C. 92
D. 1
7. What is the term used for the number inside the brackets of
an array that specifies how many values the array can hold?
Group of answer choices
A. size declarator
B. size initialization
C. number declarator
D. subscript declarator
8.When a function finishes executing, it returns a value back to
the part of the program that called it.
Group of answer choices:
A. True
B. False
9. The following pseudocode is for a loop that will perform
three iterations.
For start = 5 To 10 Step 2
Do something
End For
Group of answer choices
A. True
B. False
10. If an expression is False, the __________
operator will return True.
Group of answer choices
A. All are unary operators
B. ! (NOT)
C. OR
D. AND
11. How many times would the following loop iterate?
Set k = 1
While k > 5
Display k
End While
Group of answer choices
A. infinite
B. 4
C. 0
D. 5
12. A structure that has a loop inside another loop is called a(n) __________ loop.
13. What does the following expression evaluate to, given that a
= 3 and b = 6?
(a != b) AND (b > a)
Group of answer choices
A. True
B. False
C. NOT
D. cannot tell
14. Given the following pseudocode, what would display if this
pseudocode was coded and executed, given that examGrade = 93 and
homeworkGrade = 87?
If examGrade >= 90 AND homeworkGrade >= 90 Then
Display "You are doing very well!"
Else If examGrade < 90 AND homeworkGrade >= 90 Then
Display "Study harder for the next exam."
Else If examGrade >= 90 AND homeworkGrade < 90 Then
Display "See me for help with homework."
Else
Display "Let's talk about your grades."
End If
Group of answer choices
A. See me for help with homework.
B. You are doing very well!
C. Let's talk about your grades.
D. Study harder for the next exam
15. When a variable is passed by reference to a module, changes
to the value of the argument in the module will also affect the
variable in the part of the program that sent that argument.
Group of answer choices
A. True
C. False
16. Given the following pseudocode, what is the value of myGrade
after the call to the curveScore module?
Module main()
Declare Integer myGrade
Set myGrade = 82
Call curveScore(myGrade)
End Module
Module curveScore(Integer score)
Declare Integer newScore
Set newScore = score + 5
Display newScore
End Module
Group of answer choices :
A. 87
B. can not tell
C. 82
D. 5
17. A(n) __________ constant is a named constant that is
available to every module in the program.
18. The following two expressions will always yield identical
results:
(a + b) / c
a + b / c
Group of answer choices
A.True
B. False
19. Which of the following error types produces incorrect
results but does not prevent the program from running?
Group of answer choices
A. logic
B. syntax
C. grammar
D. human
20. What is the error in the following pseudocode?
Display "What is your name?"
Input userName
Declare String userName
Group of answer choices :
A. There is no error.
B. userName is an invalid variable name
C. The Input statement should be the first statement.
D. userName has been used before it is declared
Solution:
1)
False
Explanation:
The object fields which are given the access specifier as private will only be accessible from within the class.
2)
D. Procedural/ Structural
Explanation:
Procedural/ Structural programming mainly focuses on procedures and structures which are defined in it.
3)
Object-oriented
Explanation:
Object-oriented programming focusses on bundling the attributes and behavior of an object so that it can be defined completely.
4)
True
Explanation:
Any of the sorting algorithms can be used to sort the elements in the array.
5)
x and y have swapped their values.
Explanation:
The logic is to swap the values of x and y.
6)
D. 1
Explanation:
83,92,78,94,61
will be stored in the array as
0 | 1 | 2 | 3 | 4 |
83 | 92 | 78 | 94 | 61 |
we can see that 92 at index 1.
7)
B. size initialization
8)
True
Explanation:
The objective to call a method is to get the value which is being calculated through it.
9)
false
Explanation:
The loop is performing 5 iterations.
10)
B. ! (NOT)
11)
C. 0
Explanation:
The loop will terminate as the first condition will be false.
12)
Nested
13)
(a != b) AND (b > a)
will be evaluated as
(3 != 6) AND (6 > 3)
True AND True= True
The answer is true.
14)
See me for help with homework.
15)
True
16)
A. 87
17)
global
18)
False
19)
A. logic
20)
B. userName is an invalid variable name
Explanation:
This error is for the second declaration of userName.
Hit the thumbs up if you liked the answer. :)