stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
CP Java PMDAS Review Flashcards | StudBud
Explore
/
CP Java PMDAS Review
CP Java PMDAS Review
41 terms
·
StudBud Administration
Programming and Logic II Review
Flashcards
41 cards
F
Practice quiz
P
Host live
L
Questions
41
Answers
1
Think of a _______ as a cookie cutter and ________ as the cookies.
class; objects
object; classes
field; methods
class; fields
2
The two primary methods of programming in used today are ___________ and ____________
Alice
Lua
Object oriented
Procedural
3
A Java program must have at least one
comment
class definition
variable
print
4
What will be the value of bonus after the following code is executed?
500
1000
1250
750
5
What will be the values of x and y as a result of the following code?
x=33,y=9
x=33,y=8
x=25,y=8
x=34,y=9
6
Which loop repeats a specific number of times?
infinite loop
sentinel loop
conditional loop
count-controlled loop
7
Which of the following expressions will determine whether x is less than or equal to y?
x =< y
x >= y
x <= Y
x > y
8
A runtime error is usually the result of
a logical error
a syntax error
bad data
a compilation error
9
What will be the value of x after the following code is executed?
135
60
15
75
10
What are methods that operate on an object's fields?
public methods
instance variables
instance methods
private methods
11
What will be the value of ans after the following code has been executed?
20
145
10
No value, there is a syntax error
12
Which one is not involved in defining what the program is to do ?
output
processing
input
compile code
13
What is the standard output and input devices? (usually the keyboard and mouse)
CPU
CRT
Console
Flash Drive
14
The ___________ statement is used to make simple decision in Java
do-while
if
switch
for
15
What will be displayed as a result of executing the following code?
x=37,y=5
x=32,y=4
x=9,y=52
x=160,y=80
16
What will be the value of ans after the following code has been executed?
10
No value, there is a syntax error
120
100
17
What value signals when the end of a list of values has been reached?
end value
terminal value
sentinel value
final value
18
Before entering a loop to compute a running total, the program should first
know exactly how many values there are to total
set the accumulator to 0
set all variables to 0
read all the values into main memory
19
What is the result of the following statement?
7
19
3
5.25
20
A object contains _________ and _______________
data
procedures
students
grades
21
Class objects have __________ that perform useful operations on their data.
methods
relationships
instances
fields
22
What will be the value of x after the following code is executed?
90
210
110
This is an infinite loop
23
Which of the following is not a primitive data type?
short
long
float
string
24
Byte code instructions are
machine code instructions
interpreted by the JVM
syntax error
another name for source code
25
What does the keyword new do?
creates a new Java byte code file
creates a new variable in memory
creates an object in memory
creates a new class
26
The decision structure that has two possible paths of execution is known as _______.
two alternative
single alternative
dual alternative
double alternative
27
What will be the value of z as a result of executing the following code?
5.0
5.60
5.6
3.0
28
10110000 is an example of an instruction written in which computer language?
Python
Machine language
C#
Assembly language
29
Character literals are enclosed in ___________; string literals are enclosed in ________.
single quotes; double quotes
double quotes; double quotes
single quotes; single quotes
double quotes; single quotes
30
What is the result of the following expression?
-50
25
5
-5
31
How many times will the following for loop be executed?
0
10
11
12
32
One or more objects may be created from:
an instance
a class
a field
a method
33
Which of the following is true of a constructor?
has the same name as the class
has return type void
always has an access specifier of private
always accepts two arguments
34
What will be displayed when the following code is executed?
x=22,y=26
x=22,y=4
x=22, y=88
Nothing, this is an error
35
Which mathematical operator is used to raise five to the second power?
MOD
/
^
~
36
What does a UML diagram not contain?
fields
class name
methods
object names
37
Use this type of loop in situations where the exact number of iterations is known.
while loop
do-while loop
for loop
if statement
38
Define syntax:
symbols
key words
rules for writing code
punctuation for code
39
A loop that does not stop is called _____________.
a while loop
a do-while loop
an infinite loop
a for loop
40
What will be the values of ans, x, and y after the following statements execute?
ans=45,x=50,y=0
ans=60,x=0,y=50
ans=60,x=50,y=100
ans=45,x=50,y=50
41
What will be the value of x after the following code is executed?
This is an infinite loop
110
100
90