Question: 1. View the code below and indicate where each variable would have scope. (Circle all boxes for each variable in which that variable would be

1. View the code below and indicate where each variable would have scope. (Circle all boxes for each variable in which that variable would be useable.

class DoLittle { public static void main(String[] args) { int number = 3;

double cost = 11.00; while(number >= 0) { int value = 7;

if(value > 5){ value = value + 2; number = number - 1;

String message = good job!;

}

} value = 9;

System.out.println(cost); } }

Variables In which blocks is each useable?

number main method while loop if block

cost main method while loop if block

value main method while loop if block

message main method while loop if block

in java

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!