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
In a c program, if you see a variable in main declared: float farray[20]; describe what farray is
Bas_tet [7]
An array of floats that can hold up to 20.
3 0
3 years ago
I want to build a video player on the html5 canvas here is my code
jok3333 [9.3K]

Answer:

hospital yestrday after noon ggpupg ki tyutrdcbhsjdvshsjjshsgsgdhsusfsuwwiiwhszia

8 0
1 year ago
All of the following changes have created an urgent need for centralization except: Select one: a. The Internet boom inspired bu
kifflom [539]

All of the following changes have created an urgent need for centralization except The number of qualified software programmers and PC repair technicians is dwindling

<h3><u>Explanation:</u></h3>

When the processing tasks are carried out on a centralized server it refers to the Centralization. In this type of architecture all the computer systems will be connected to a single server in which all the computational work are performed. The client machines that are connected to the central server will get the resources for computing from the centralized server.

The main reasons for the purpose of centralization includes the following such as the development in the internet that required many computer networks, the basic functioning of the business in which the needed applications are fed on the intranets, the cost associated in the maintenance of personal computers on the single network.

3 0
3 years ago
Considering the traffic problem, do you think Rod handled the situation well?
svet-max [94.6K]
No he did not that was a poor choice.
7 0
3 years ago
Which is the most common way to install memory in a laptop?
alina1380 [7]

install memory requires you to take off the bottom portion of the laptop.

7 0
3 years ago
Other questions:
  • Which loan type requires you to make loan payments while you’re attending school?
    10·1 answer
  • Grooves and polished surfaces on desert pebbles are most likely caused by
    10·1 answer
  • ____ includes any attempt to intentionally conduct dishonest activities online.
    5·1 answer
  • Users of an access point share the transmission capacity of the access point. The throughput a user gets is called the ________.
    11·1 answer
  • There are....... section in<br>cpu<br>​
    15·1 answer
  • Assuming dataFile is an ofstream object associated with a disk file named payroll.dat, which of the following statements would w
    9·1 answer
  • Who watches the show gravity falls, if you do, if you play the theme song for the first episode backwards you get a hiding messi
    11·2 answers
  • Why should you try out a camera bag before taking it on a vacation?
    7·2 answers
  • What does the top level domain in a url inducate? A. The organization or company that owns the website. B. The organization or c
    6·2 answers
  • 8.1.4: Ghost Invasion!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!