62. is a formal process that seeks to understand the problem and document in detail what the software
system needs to do.
a. Requirements specification
b. Analysis
c. Design
d. Implementation
e. Testing
#
63. seeks to analyze the data flow and to identify the system’s input and output. When you do
analysis, it helps to identify what the output is first, and then figure out what input data you need in order to produce
the output.
a. Requirements specification
b. Analysis
c. Design
d. Implementation
e. Testing
#
Section 2.18 Case Study: Counting Monetary
62. Suppose int x = 3264, what is the output of the following code?
int y = x % 10;
x = x / 10;
System.out.println(“x is ” + x + ” and y is ” + y);
a. x is 3264 and y is 326.4
b. x is 326 and y is 326
c. x is 326 and y is 4
d. x is 3264 and y is 4
e. x is 4 and y is 326
#
Section 2.19 Common Errors and Pitfalls
64. Analyze the following code:
public class Test {
public static void main(String[] args) {
int n = 10000 * 10000 * 10000;
System.out.println(“n is ” + n);
}
}
a. The program displays n is 1000000000000.
b. The result of 10000 * 10000 * 10000 is too large to be stored in an int variable n. This causes an overflow and
the program is aborted.
c. The result of 10000 * 10000 * 10000 is too large to be stored in an int variable n. This causes an overflow and
the program continues to execute because Java does not report errors on overflow.
d. The result of 10000 * 10000 * 10000 is too large to be stored in an int variable n. This causes an underflow and
the program is aborted.
e. The result of 10000 * 10000 * 10000 is too large to be stored in an int variable n. This causes an underflow and the
program continues to execute because Java does not report errors on underflow.