1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
makkiz [27]
3 years ago
7

Write test programs in java to determine the scope of a variable declared in a for statement. Specifically, the code must determ

ine whether such a variable is visible after the body of the for statement
Computers and Technology
1 answer:
xxMikexx [17]3 years ago
6 0

Answer:

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        for(int i = 1; i < 10; i++){
  4.            int num = 0;
  5.            num += i;
  6.        }  
  7.        System.out.println(num);
  8.    }
  9. }

Explanation:

In programming each variable has its scope. For example, a variable defined within the for loop has no longer exist outside the loop body. To illustrate this we can write a short program as presented above.

Firstly, create a for loop that traverse the number 1 - 10 (Line 5 - 8). Within the loop create a variable num and initialize it with zero (Line 6) and increment it with i value for each iteration (Line 7).

Outside the loop, we try to print the num (Line 9). When we run the program this will result in an error as the num which is declared inside the for loop will no longer exist outside the loop body.  

You might be interested in
The Caesar Cipher has 25 different shifts to try.
statuscvo [17]

Answer:

D. 25x24x23x22x21.....3x2x1.

Explanation:

The ceasar cipher is a encryption technique, that uses a combination of information or keys to encrypt an information.

The 25 shift ceasar cipher has 25 different combinations, so the number of probable random cipher substitution is 25!,

That is = 25 × 24×23× 22×..... ×2×1.

3 0
3 years ago
What is a Boolean Expression?
ratelena [41]
The answer is C, an expression that evaluates to true or false.

In computer science, a Boolean expression is an expression used in programming languages that produces a Boolean value when evaluated. A Boolean value is either true or false.

( Lol. I’m in 7th grade doing college work, so this was fun to answer! )
4 0
3 years ago
What is a good rule of thumb for how much white space you should have in a flyer or poster
almond37 [142]
Poster because if you have that much space....well what I do is calculate it by the centimeters in square divide:)
6 0
3 years ago
Read 2 more answers
Audra is creating a training document and would like to include an image that she sees on her screen that she has marked up for
kupik [55]

Answer:

the first and last one

Explanation:

give me brainilest

4 0
3 years ago
Read 2 more answers
Which is NOT a valid compute shape option within the Oracle Cloud Infrastructure (OCI) compute service
inessss [21]

The option that is not a valid compute shape option within the Oracle Cloud Infrastructure (OCI) compute service is;

A: Container Instance

<h3>Cloud Computing</h3>

Cloud computing is simply a system that makes use of the Internet to store, manage and access data from a remote server on the internet.

Now, this cloud system infrastructure makes use of middleware software to ensure that there is proper connectivity between devices and computers connected via the cloud.

Finally there are different types of cloud computing shape but among the given options the only one that is not a type is Option A.

The missing options are;

A) Container Instance.

B) Bare Metal.

C) Dedicated Virtual Machine Host.

D) Virtual Machine.

Read more about cloud computing at; brainly.com/question/19057393

6 0
2 years ago
Other questions:
  • Two electronics technicians are measuring electrical quantities in circuits. Technician A says that copper, glass, porcelain, an
    11·1 answer
  • ________ are the most popular method used by visitors to find web sites.
    6·1 answer
  • You learned that properly edited resumes are necessary for making a good impression on a university or a potential employer. Dis
    13·1 answer
  • “identify the skill in the following scenario” :
    6·2 answers
  • Does anyone know why I get notifications on Brainly that say they are from 4 hours ago even though they were just answered
    9·1 answer
  • This is a python program.
    6·1 answer
  • 1 point
    5·2 answers
  • Who is your favorite person from squid game?
    13·2 answers
  • How do you modify WordArt? Give specific details and steps<br><br> NEED THIS ASAP
    9·1 answer
  • The rectangular symbol in flowchart<br> is used to denote dash
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!