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