Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Which of the following are local data (local variables)? balance name acctNum

ID: 3731247 • Letter: 1

Question

1. Which of the following are local data (local variables)?

balance

name

acctNum

initBal

owner

number

withdraw

amtToTake

deposit

amtToAdd

getBalance

toString

s

There are no local variables

2. Which of the following are actual parameters (also called arguments)?

balance

name

acctNum

initBal

owner

number

withdraw

amtToTake

deposit

amtToAdd

getBalance

toString

s

There are no actual parameters

3. Which of the following are formal parameters (also called parameters)?

balance

name

acctNum

initBal

owner

number

withdraw

amtToTake

deposit

amtToAdd

getBalance

toString

s

There are no formal parameters

4. Which of the following comprise the state of an Account object?

balance

name

acctNum

initBal

owner

number

withdraw

amtToTake

deposit

amtToAdd

getBalance

toString

s

Account objects have no state

5. Which of the following are mutators?

balance

name

acctNum

initBal

owner

number

withdraw

amtToTake

deposit

amtToAdd

getBalance

toString

s

There are no mutators

balance

name

acctNum

initBal

owner

number

withdraw

amtToTake

deposit

amtToAdd

getBalance

toString

s

There are no local variables

Explanation / Answer

1. Which of the following are local data (local variables)?

Answer: s

2. Which of the following are actual parameters (also called arguments)?

Answer:

There are no actual parameters

3. Which of the following are formal parameters (also called parameters)?

Answers:

initBal

owner

number

amtToAdd

4. Which of the following comprise the state of an Account object?

Answer:

toString

5. Which of the following are mutators?

Answer:

withdraw

deposit