Question 1 (1 point) Question 1 Unsaved According to the Google style guide, Java variable and class names should be named using UpperCamelCase. Question 2 (1 point) Question 2 Unsaved Analyze the following code: public class Test { public static void main (String args[]) { int i = 0; for (i = 0; i = 1) { if (balance 0); { System.out.println(“x”); } Question 11 (1 point) Question 11 Unsaved What is the value of balance after the following code is executed? int balance = 10; while (balance >= 1) { if (balance < 9) { continue; } balance = balance – 9; } Question 12 (1 point) Question 12 Unsaved Using the Google style guide document, select the proper declaration of a Java constant. Question 13 (1 point) Question 13 Unsaved Analyze the following code. int x = 1; while (0 < x) && (x < 100) System.out.println(x++); Question 14 (1 point) Question 14 Unsaved How many times will the following code print "Welcome to Java"? int count = 0; do { System.out.println("Welcome to Java"); count++; } while (count 9) { if (y > 8){ System.out.println(“x > 9 and y > 8”); } else if (z >= 7){ System.out.println(“x = 7”); } else { System.out.println(“x <= 9 and z < 7"); } } Question 17 (1 point) Question 17 Unsaved How many times does the following loop iterate? public class Quizzes { public static void main(String args[]){ int cnt = 1; int maxLoop = 30; while (cnt < maxLoop) { if (cnt==3) { break; } cnt++; } } } Question 18 (1 point) Question 18 Unsaved What is the output of the following Java code? ___________________ public class Quizzes { public static void main(String args[]){ String string1 = "CMIS141 "; String string2 = "is all"; String string3 = "about Java!"; String concat = string3.concat(string2).concat(string1); System.out.println(concat.length()); } } Question 19 (1 point) Question 19 Unsaved What is the output of the following Java code: ____________________. public class Quizzes { public static void main(String args[]){ double examAvg = 85.9983; System.out.println(Math.ceil(examAvg)); } } Question 20 (1 point) Question 20 Unsaved What is the output of the following fragment? int i = 1; int j = 1; while (i < 5) { i++; j = j * 2; } System.out.println(j); Question 21 (1 point) Question 21 Unsaved What method would you use in the Scanner class to read an int from standard input in Java? Question 22 (1 point) Question 22 Unsaved What is y after the following for loop statement is executed? int y = 0; for (int i = 0; i < 10; i++) { y += 1; } Question 23 (1 point) Question 23 Unsaved The following Java code contains valid brace placement according to the Google style guide public class MyClass { public static void main(String[] args) { System.out.println("Welcome to CMIS 141"); } // End of main } // End class Question 24 (1 point) Question 24 Unsaved Analyze the following two code fragments. (i) int x = 5; if (0 < x) && (x < 100) System.out.println("x is between 1 and 100"); (ii) int x = 5; if (0 < x && x < 100) System.out.println("x is between 1 and 100"); Question 25 (1 point) Question 25 Unsaved How would you construct an instance of scanner class that will read from the standard input (keyboard) in Java?
1. (TCO 4) In the parameter list of a sub procedure, each parameter has a procedure scope, and each stores _____. (Points : 2)
arguments
an item of data
values
references
Question 2.2. (TCO 4) When you pass a variable ____, the computer passes only the contents of the variable to the receiving procedure. (Points : 2)
by reference
by parameter
by data type
by value
Question 3.3. (TCO 4) The _______ section in a function header identifies the data type of the data being returned. (Points : 2)
by value
DataType
by reference
As dataType
Question 4.4. (TCO 2) The syntax ____ assigns a return value to a variable. (Points : 2)
dblNewPrice = GetNewPrice(dblCurrentPrice)
lblNewPrice.Text = GetNewPrice(dblCurrentPrice).ToString
Dim dblNewPrice
dblNewPrice = dblCurrentPrice
Question 5.5. (TCO 2) In a ____ combo box, the text portion is not editable. (Points : 2)
Text
Simple
DropDown
DropDownList
Question 6.6. (TCO 2) The default combo-box style in Visual Basic is ____. (Points : 2)
Text
Simple
DropDown
DropDownList
Question 7.7. (TCO 2) As you do with a list box, you use the Items collection’s ____ method to add an item to a combo box. (Points : 2)
Insert
Add
New
Append
Question 8.8. (TCO 2) A combo box’s ____ property contains the value that appears in the text portion of the control. (Points : 2)
Add
Sorted
Text
List
Question 9.9. (TCO 3) A(n) ____ is a group of variables that have the same name and data type and are related in some way. (Points : 2)
subscript
string
array
run-time error
Question 10.10. (TCO 3) The data used to initialize the elements of an array are enclosed in ____. (Points : 2)
[ ]
{ }
( )
” ”
Question 11.11. (TCO 3) Which of the following correctly shows the syntax for storing data into a one-dimensional array? (Points : 2)
arrayname = value
arrayname(subscript) = value
arrayname = {value}
arrayname(subscript) = {value}
Question 12.12. (TCO 3) If a one-dimensional array contains 5 elements, its highest subscript is ____. (Points : 2)
4
5
6
7
Question 13.13. (TCO 3) To refer to the element located in the first row, first column in a two-dimensional array named strProducts, you use ____. (Points : 2)
strProducts(0, 0)
strProducts{0, 1}
strProducts(1, 1)
strProducts[0, 0]
Question 14.14. (TCO 3) Based on the code below, intScores(0, 0) is initialized to ____.
Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}} (Points : 2)
9
25
75
90
Question 15.15. (TCO 3) The statement ____ assigns the string “Arctic” to the element located in the second row, first column in the strOceans array. (Points : 2)
strOceans(1, 1) = {Arctic}
strOceans(0, 0) = (Arctic)
strOceans(1, 0) = “Arctic”
strOceans(0, 1) = “Arctic”
Question 16. 16. (TCO 4) Create a method named GetSum() that accepts three floating-point numbers, adds the three values, and then returns the sum as a floating-point number. (Points : 5)
"96% of our customers have reported a 90% and above score. You might want to place an order with us."