Java and Correct Answer

Only available on StudyMode
  • Download(s) : 503
  • Published : March 9, 2012
Open Document
Text Preview
Chapter 2 Practice Quiz
* Grade for: Chapter02-23
A variable's scope is the part of the program that has access to the variable. | |
Student Response| Value| Correct Answer|
not answered | 0% | True|
|
* Grade for: Chapter02-19
Named constants are initialized with a value, that value cannot be changed during the execution of the program. | |
Student Response| Value| Correct Answer|
not answered | 0% | True|
|
* Grade for: Chapter02-50
Programming style includes techniques for consistently putting spaces and indentation in a program so visual cues are created. | |
Student Response| Value| Correct Answer|
not answered | 0% | True|
|
* Grade for: Chapter02-27
In Java the variable named One is the same as the variable named ONE. | |
Student Response| Value| Correct Answer|
not answered | 0% | False|
|
* Grade for: Chapter02-38
Variables of the boolean data type are useful for |
|
 | Student Response| Value| Correct Answer| Feedback| A. | working with small integers| |   |  |
B. | evaluating true/false conditions| |   |  |
C. | working with very large integers| |   |  |
D. | evaluating scientific notation| |   |  |
|
* Grade for: Chapter02-35
The primitive data types only allow a(n) ________ to hold a single value. | |
 | Student Response| Value| Correct Answer| Feedback| A. | variable| |   |  |
B. | object| |   |  |
C. | class| |   |  |
D. | literal| |   |  |
|
* Grade for: Chapter02-42
To convert from one data type to another you must use casting | |
 | Student Response| Value| Correct Answer| Feedback| A. | when you are converting from a lower-ranked value to a higher-ranked value| |   |  | B. | when you are converting from a higher-ranked value to a lower-ranked value| |   |  | C. | always| |   |  |

D. | never| |   | |
|
* Grade for: Chapter02-36
If x has been declared an integer, int x;, which of the following is invalid? | |
 | Student Response| Value| Correct Answer| Feedback| A. | x = 0;| |   |  |
B. | x = -58932;| |   |  |
C. | x = 1,000;| |   |  |
D. | x = 592;| |   |  |
 | Score:| 0%|
|
* Grade for: Chapter02-26
When saving a Java source file, save it with an extension of | |
 | Student Response| Value| Correct Answer| Feedback| A. | .javac| |   |  |
B. | .class| |   |  |
C. | .src| |   |  |
D. | .java| |   |  |
|
* Grade for: Chapter02-10
Which of the following is not a primitive data type? |
|
 | Student Response| Value| Correct Answer| Feedback| A. | short| |   |  |
B. | long| |   |  |
C. | float| |   |  |
D. | String| |   |  |
|
* Grade for: Chapter02-49
Which of the following is not a valid comment in Java? |
|
 | Student Response| Value| Correct Answer| Feedback| A. | Single line comments, two forward slashes - //| |   |  | B. | Multi-line comments, start with /* and end with */| |   |  | C. | Multi-line comments, start with */ and end with /*| |   |  | D. | Documentation comments, any comments starting with /**| |   |  |

|
* Grade for: Chapter02-17
Which of the following will correctly convert the data type, if x is an integer and y is a double? | |
 | Student Response| Value| Correct Answer| Feedback| A. | | |   |  |
B. | x = int y;| |   |  |
C. | x = (int)y;| |   |  |
D. | x = y;| |   | |
|
* Grade for: Chapter02-24
What will be displayed as a result of executing the following code?

|
|
 | Student Response| Value| Correct Answer| Feedback| A. | 9
45
16| |   |  |
B. | 94516| |   |  |
C. | 9 45 16| |   |  |
D. | Nothing, this is an error| |   |  |
|
* Grade for: Chapter02-16
What is the...
tracking img