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