Question: 1. Where can local variables declared within a methods body be used? a. Only in that method between the line in which they were declared

1. Where can local variables declared within a methods body be used?

a. Only in that method between the line in which they were declared and the cosing brace of that method.

b. Same as (a), but not within while or if statements?

c. Only within while or if statements within the method in which they were declared.

d. Anywhere within the class.

2. Which statement is true? (Select all that apply)

a. Dividing two integers results in integer division.

b. With integer division, any fractional part of the calculation is lost.

c. With integer division, any fractional part of the calculation is truncated.

3. Counter-controlled repetition requires: (Select all that apply)

a. A control variable and initial value.

b. A control variable increment (or decrement).

c. A condition that tests for the final value of the control variable.

d. A sentinel value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!