1/33
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
If I have a file, TestFile.java, what do I type in Command Window to compile the file and run the file?
javac TestFile.java
What are the characteristics of machine language?
The instructions are in the form of binary code. The programs are highly difficult to read and modify
What are the characteristics of assembly language?
Developed to make programming easy. A program called assembler is used to convert assembly language programs into machine code. Symbolic
What are the characteristics of high-level language?
Are English-like and easy to learn and program.
What is 52 % 8?
4 (remainder)
How to concatenate strings in System.out.println ?
+
What is the output of the following code?
int a = 10;
int b = 3;
System.out.println("a/b is" + a/b);
a/b is 3
Which of the following is NOT a valid variable name?
1stHalf
What is the output of the following code?
double a = 6.5;
a += a + 1;
System.out.println(a);
14.0
Analyze the following Java code:
int a = 1;
int b = 2;
int c = 3;
int answer = b-- - a++ * ++c;
What is answer?
4
When displaying output within the quotes, how do you insert a new line?
\n
215 in hexadecimal is what in binary number?
0010 0001 0101
Analyze the following Java code:
int x = 8;
int y = 4;
int z = 2;
double answer = x + y / Math.pow(z, z);
What is answer?
9.0
What is the output of the following fragment?
for(int i=0; i<=15; i++){
if((i%4)==1)
System.out.printf("%d",i);
}
1 5 9 13
Consider the following code that assigns a letter grade to a student's score:
if(score>=90) grade="A";
if(score>=80) grade="B";
if(score>=70) grade="C";
if(score>=60) grade="D";
else grade="F";
This code will work correctly only if grade < 60
Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?
((x < 100) && (x > 1)) || (x < 0)
If x = true, y = 10, z = 20, evaluate !x || (y == (z/2)
true
If x = true, y = 10, z = 20, evaluate x && !(y*2 <= z)
false
What is the position of a value in an array called?
A collection of statements that are grouped together to perform an operation
method
Syntax for a method header
modifier returnType methodName (list of formal parameters)
Syntax to call a method with a return value
returnDataType variable = methodName (list of parameters)
Formal parameters and actual parameters must match in _____________, ______________, and _______________.
number, order, and data type
Does a void method have a return statement?
no; the method performs some actions
How do you call a method from a different class?
ClassName.methodName
What are overloaded methods?
Enable you to define the methods with the same name as long as their signatures are different
The part of the program where the variable can be referenced
Scope
A variable defined inside a method
local variable
A data structure that represents a collection of the same types of data
Array
How do you declare an Array
dataType[] arrayRefVar;
What are the values in an array called?
elements
A while-loop is a _________________-controlled loop
event
A for-loop is a ________________-controlled loop
count
A for-loop executes a fixed number of times?
True