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
lisov135 [29]
3 years ago
13

To print the last element in the array named ar, you can write :A. System.out.println(ar.length);

Computers and Technology
1 answer:
timofeeve [1]3 years ago
3 0

Answer:

Option (d) is the correct answer.

Explanation:

An Array is used to store multiple variables in the memory in the continuous memory allocation on which starting index value is starting from 0 and the last index value location is size-1.

In java programming language the array.length is used to tells the size of the array so when the user wants to get the value of the last element, he needs to print the value of (array.length-1) location so the correct statement for the java programming language is to print the last element in the array named ar is--

System.out.println(ar[ar.length-1]);

No option provides the above statement, so option d (None of these) is correct while the reason behind the other option is not correct is as follows--

  • Option a will prints the size of the array.
  • Option b also gives the error because length is an undeclared variable.
  • Option c will give the error of array bound of an exception because it begs the value of the size+1 element of the array.
You might be interested in
How do you change colors for presentation to blue warm in power point?
Furkat [3]

In PowerPoint presentations you can change background color. The best way to do this is to change the template background color in the master view. This will let you use the same background color among the whole presentation and also for the new slides that you will create.

In order to change the background color in Microsoft PowerPoint 2010 we need to go to View and Slide Master. Then, right click on the first slide and click Format Background.

5 0
3 years ago
What is a parameter variable?
max2010maxim [7]

Answer:

Option c: A variable that is declared in the header of a method.

is correct answer.

Explanation:

  • Parameter variable is also known as Reference variable. They are used while dealing with functions, methods or procedures in order to pass the value(variable) to the method and getting the output value back as return.
  • The parameter variable is written in front of the method's name inside the parenthesis, in the method's header indicated by keyword "var".
  • Parameter variables are infact the assumed names for actual arguments that are given by calling routine.
  • Passing parameter variables to a function is further divided into two parts:
  1. Pass by reference
  2. Pass by value

i hope it will help you!

6 0
3 years ago
Write an algorithm to find the average of three numbers: 10, 20, 30
STALIN [3.7K]

Language: JavaScript

Answer:

let num = [10,20,30];

average(num);  

function average(num) {

 let sum = 0;

 for(let i in num) {

   sum += num[i];

 }  

 return console.log(sum/num.length);

}

3 0
3 years ago
Sarah's research shows that business information management professionals also perform the duties of other professionals. Which
aev [14]

Answer:

Business information management professionals also perform duties of <u>management</u> information systems professionals

Explanation:

A career in business information requires a diploma or degree in business information management or business administration as well as being required to carry out the tasks of a management information systems (MIS) professional of which the knowledge required on data communications and computers can be obtained by completion of a certification or degree in MIS or an associate degree in information technology. In addition, a strategic management certification can further improve a career in business information management.

3 0
3 years ago
When listing columns in the select list, what should you use to separate the columns?
Gala2k [10]
The answer is commas.  <span>When listing columns in the select list, commas should be used to separate the columns.</span>
6 0
3 years ago
Other questions:
  • Over time, attackers have had to increase their skills to be able to attack systems or create viruses. True False
    8·1 answer
  • Which tab provide text formatting features
    11·1 answer
  • ) How many switching functions of two variables (x and y) are there?
    11·1 answer
  • How often does colleges update the cost of attendance on their website?.
    13·1 answer
  • What is the difference between C and C++. If I know C, will it be hard to lean C++?
    15·1 answer
  • Did brainly.com go down today? i coudlnt get in it
    15·2 answers
  • Could u give me brief summary of New Years
    14·2 answers
  • Which key combination should you use
    9·2 answers
  • Defination of formula work sheet​
    15·1 answer
  • Which of the following online creation tools will be used if a person wants to create a video presentation?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!