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
Rasek [7]
3 years ago
9

You are writing a program that defines a variable within a loop, and then tries to use that variable outside the loop. However,

the program does not run as intended. What is the issue?
Computers and Technology
1 answer:
Law Incorporation [45]3 years ago
4 0

Answer:

The Variable is out of scope

Explanation:

In programming variables exists with scopes This could be local or global. When a variable is declared as a global variable it is available to all methods and procedures in the program. Java programming language as well as C++ and several others use the open and close braces to define the scope in programs. consider the following example

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>        int i = 0;</em>

<em>        while ( i<10){</em>

<em>            int sum = 0;</em>

<em>            sum = sum+i;       </em>

<em>        }</em>

<em>    }</em>

<em>}</em>

In this example, the variable i is global and can be assessed within the while loop but the variable sum is local to the while loop and cannot be assessed outside of it

You might be interested in
18. The push rod connects to the _______, which is designed to pivot back and forth to open and close the valve.
spin [16.1K]
In an overhead valve engine, pushrods connect to A. rocker arm which pivots and opens valves
6 0
3 years ago
Read 2 more answers
_______and ________ enables computers to communicate and it can pass information between two networks.
lozanna [386]

Answer:

Internet Protocol and Transmission Control Protocol        

Explanation:

Internet protocol, which is also known as IP and Transmission Control Protocol, which is also known as TCP are the two important protocols that enables the computers to communicate various information and data and allow it to pass between two networks. It allows computers to connect to each other.  They are developed by Bob Kahn and Vint Cerf.

4 0
3 years ago
How is the number 13,000 abbreviated in scientific notation?
Gennadij [26K]
<span> 13,000 is the same as 1.3 x 10^4</span>
3 0
3 years ago
Read 2 more answers
In network security, a firewall is a device which lies between two networks.
AfilCa [17]
The answer is A. A firewall is a piece of software that monitors all connections to make sure no attacks can be made in the internal or external networks
4 0
3 years ago
Multiple layers provide multiple road blocks for a ________.
Hatshy [7]

Individual or other words user and attackers

4 0
3 years ago
Other questions:
  • Jacob is a teacher and wants to sort his grades based on Test 1 and then on Test 2.
    14·2 answers
  • Using features on demand results in saving potentially significant amounts of disk space. features on demand becomes a third ins
    14·1 answer
  • T F The scope of a parameter is limited to the function which uses it.
    12·1 answer
  • In the world of computers, the term ____ refers to the computerâs physical components, such as the monitor, keyboard, motherboar
    14·1 answer
  • Which chart element provides the boundaries of the graphic?
    10·2 answers
  • Compressing a file is also called
    9·2 answers
  • What are the components that make a computer work?
    12·1 answer
  • What does 69 mean?<br> Whenever I watch memes they always talk about the number 69
    8·2 answers
  • If wearing protective gloves, there's no need to wash your hands after exposure to blood.
    14·1 answer
  • Choose the answer that best completes the visual analogy.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!