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
wariber [46]
3 years ago
7

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

rmine whether such a variable is visible after the body of the for statement

Computers and Technology
1 answer:
ankoles [38]3 years ago
7 0

Answer:

See Explaination

Explanation:

public class testscope

{

//start of main function

public static void main(String[] args)

{

//varible declration

int i;

int x;

//loop for 10 times

for(i=0; i<10; i++)

{

//initialize value of x to 10

x = 10;

}

//the scope of variable x is visible outside of for loop

System.out.println("The value of x is: "+x);

}

}

See attachment for sample output

nb:

You can clearly see in the output of Java program the value of x is not printed and program return errors. It means the variable x declared inside for loop does not has scope outside the for loop.

You might be interested in
The rules on the Internet for how messages are addressed and passed on are called ____ .
olganol [36]
Answer: Internet Protocal (IP)
7 0
3 years ago
The IT person most involved with system development is the _________
laila [671]

Answer:

douch

Explanation:

3 0
3 years ago
____ 59. Suppose that x and y are int variables, ch is a char variable, and the input is: 4 2 A 12 Choose the values of x, y, an
Vlada [557]

Answer:

d. This statement results in input failure.

Explanation:

We are taking input of 3 variables only and those are x,ch,and y. cin is a C++ keyword used take input entered by the user onto the screen cin is not a variable.

The input should of type int char int as written in the code. First is x and character variable ch and then the integer variable y and there should be only three inputs.

8 0
3 years ago
Read 2 more answers
What is spread sheet software?​
melamori03 [73]

Answer:

The answer to this question is given in the explanation section.

Explanation:

This is a type of software which show us data in tabular form. These software can easily store, analyze and organize data.

They are divided in rows and columns. They are mainly used for accounting and book keeping.

The commonly used spread sheet software in the market are MS Excel by Microsoft, Calc by libre office.

3 0
3 years ago
Both successors to C++, _____ , by Sun Microsystems, and _______, by rival MicroSoft, are very similar.
Tanzania [10]

Answer: Java and Forth

Explanation:

   C ++ and Java are comparatively similar language which are composed statically, unequivocally, and obviously. Both language are the object-oriented and planned with the semi-interpretation and run-time during the compilation of the time.

Both uses the curly braces and also they are very similar language as compared with c# and c. Both the successors in the C++ , java and sun micro-system are similar in terms of Microsoft.

 

8 0
3 years ago
Other questions:
  • Have you ever tried to teach a class full of restless, active sixth-graders? I have. I taught sixth-grade students for 12 years.
    15·1 answer
  • From the standpoint of the governing bodies of .com, why is it important that owners of individual domains maintain authoritativ
    5·1 answer
  • Which is the correct expansion of the term Internet? 
    9·2 answers
  • FIND THE 6 ERRORS IN THIS RESUME 30 POINTS!!!!
    12·1 answer
  • How do you get free Wifi on your phone without paying
    6·1 answer
  • Write a loop to print 10 to 90 inclusive (this means it should include both the
    10·1 answer
  • Which of the following types of computers is typically used by governments and hospitals and can support hundreds of users?
    6·2 answers
  • What are the three control statements in Qbasic?​
    10·1 answer
  • Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating-point number fo
    5·1 answer
  • To read encrypted data, the recipient must decipher it into a readable form. What is the term for this process?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!