Package deal
CPS 180 TESTS COMPILATION BUNDLE
CPS 180 TESTS COMPILATION BUNDLE
[Show more]CPS 180 TESTS COMPILATION BUNDLE
[Show more]A do...while loop must execute at least this many times correct answer: 1 
 
Which is NOT a Java primitive? 
a. boolean 
b. int 
c. char 
d. String correct answer: d. String 
 
To interrupt program flow and return to the top (start) of a loop, you would use which keyword? 
a. break 
b. continue 
c...
Preview 2 out of 6 pages
Add to cartA do...while loop must execute at least this many times correct answer: 1 
 
Which is NOT a Java primitive? 
a. boolean 
b. int 
c. char 
d. String correct answer: d. String 
 
To interrupt program flow and return to the top (start) of a loop, you would use which keyword? 
a. break 
b. continue 
c...
A text file contains integers separated by spaces. Read the file and display the smallest numbers in the file correct answer: See HW 8 Solution 
 
 
public static void readTextFileUsingScanner(String file) { 
try { 
Scanner sc = new Scanner(new File(file)); 
while (Next()) { 
String str = Line...
Preview 2 out of 5 pages
Add to cartA text file contains integers separated by spaces. Read the file and display the smallest numbers in the file correct answer: See HW 8 Solution 
 
 
public static void readTextFileUsingScanner(String file) { 
try { 
Scanner sc = new Scanner(new File(file)); 
while (Next()) { 
String str = Line...
int[][]values = {{3,4,5,1},{33,6,1,2}}; 
 
 int v=values[0][0]; 
 for(int[] list: values) 
 for(int element: list) 
 if (v>element) 
 v=element; 
 S(v); correct answer: 1 
 
How many elements are array matrix (int[][] matrix = new int[5][5])? correct answer: 25 
 
Which of the following statem...
Preview 2 out of 6 pages
Add to cartint[][]values = {{3,4,5,1},{33,6,1,2}}; 
 
 int v=values[0][0]; 
 for(int[] list: values) 
 for(int element: list) 
 if (v>element) 
 v=element; 
 S(v); correct answer: 1 
 
How many elements are array matrix (int[][] matrix = new int[5][5])? correct answer: 25 
 
Which of the following statem...
Keywords correct answer: Lower case words reserved by java (can't be identifiers) 
ex: public, static, class, void 
 
Expressions correct answer: a part of a statement (like a clause) 
 
Statements (source code) correct answer: a complete java instruction that causes the computer to perform an a...
Preview 2 out of 7 pages
Add to cartKeywords correct answer: Lower case words reserved by java (can't be identifiers) 
ex: public, static, class, void 
 
Expressions correct answer: a part of a statement (like a clause) 
 
Statements (source code) correct answer: a complete java instruction that causes the computer to perform an a...
Architecture Neutral correct answer: Java 
 
The main method header is written as correct answer: public static void main(String[] args) 
 
Statements in java end with correct answer: ; 
 
Programming style is important, because... correct answer: makes a program more readable 
helps reduce prog...
Preview 1 out of 4 pages
Add to cartArchitecture Neutral correct answer: Java 
 
The main method header is written as correct answer: public static void main(String[] args) 
 
Statements in java end with correct answer: ; 
 
Programming style is important, because... correct answer: makes a program more readable 
helps reduce prog...
What is the output of the following code: 
 
int x = 3; 
int y = 3; 
int z = 3/6; 
Sln(z); correct answer: 0, to fix this z would have to be a double/float and be defined as 3.0/6.0 
 
Create a constant to hold the number of cars in a lot correct answer: final int NUM_CARS; 
 
How do you name c...
Preview 1 out of 2 pages
Add to cartWhat is the output of the following code: 
 
int x = 3; 
int y = 3; 
int z = 3/6; 
Sln(z); correct answer: 0, to fix this z would have to be a double/float and be defined as 3.0/6.0 
 
Create a constant to hold the number of cars in a lot correct answer: final int NUM_CARS; 
 
How do you name c...
Write an expression that evaluates to true if and only if the integer x is greater than the integer y. correct answer: (x>y) 
 
Write an expression that evaluates to true if and only if the value of the integer variable x is equal to zero. correct answer: x==0 
 
Write an expression that evalua...
Preview 2 out of 15 pages
Add to cartWrite an expression that evaluates to true if and only if the integer x is greater than the integer y. correct answer: (x>y) 
 
Write an expression that evaluates to true if and only if the value of the integer variable x is equal to zero. correct answer: x==0 
 
Write an expression that evalua...
How many times will the following code print "Welcome to Java"? 
 
int count = 0; 
while (count < 10) { 
 Sln("Welcome to Java"); 
 count++; 
} correct answer: 10 
 
Analyze the following code. 
 
int count = 0; 
while (count < 100) { 
 // Point A 
 Sln("Welcome to Java!"); 
 count++; 
...
Preview 2 out of 11 pages
Add to cartHow many times will the following code print "Welcome to Java"? 
 
int count = 0; 
while (count < 10) { 
 Sln("Welcome to Java"); 
 count++; 
} correct answer: 10 
 
Analyze the following code. 
 
int count = 0; 
while (count < 100) { 
 // Point A 
 Sln("Welcome to Java!"); 
 count++; 
...
One-dimensional array correct answer: A linear collection of items of the same type. 
 
Physical size of an array correct answer: The size of the memory storage allocated in terms of the number of elements that can be held. 
 
Logical size of an array correct answer: The number of elements that a...
Preview 2 out of 6 pages
Add to cartOne-dimensional array correct answer: A linear collection of items of the same type. 
 
Physical size of an array correct answer: The size of the memory storage allocated in terms of the number of elements that can be held. 
 
Logical size of an array correct answer: The number of elements that a...
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Stuvia is a marketplace, so you are not buying this document from us, but from seller Classroom. Stuvia facilitates payment to the seller.
No, you only buy these notes for $30.49. You're not tied to anything after your purchase.
4.6 stars on Google & Trustpilot (+1000 reviews)
77764 documents were sold in the last 30 days
Founded in 2010, the go-to place to buy study notes for 14 years now