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
What is the last step in planning your budget
jenyasd209 [6]
Review and Revisions
8 0
3 years ago
What IEEE 802.11 wireless standard supports devices only in the 5GHz range with speeds up to 4.9Gb/s because of accepting data f
yKpoI14uk [10]

The answer is 802.11ac  

802.11ac is a type if IEEE 802.11 wireless standards that supports Multiple Input, Multiple Output antennas on sending and receiving data. This type of wireless connection supports 2.4GHz signal or frequency and data speed transfer up to 4.9Gbps. Each device or antenna can run up to 400Mbps each and the maximum device it can handle is up to 8 antennas.

8 0
3 years ago
give an example of a technical issue you were not able to resolve on your first attempt. What troubleshooting steps did you take
erastovalidia [21]
One technical issue I had was on Windows 8.1, with the charm menu not working. The troubleshooting steps to fix it was I did CTRL+SHIFT+ESC to open task manager. I then found Windows Explorer and clicked "Reload." Then everything was fine.

Hope This Helped!
6 0
3 years ago
Write a program that asks a user to roll a single die twice to get a sum value of 7. If the sum is 11, the user loses. If the su
barxatty [35]

Answer:

Check the explanation

Explanation:

#include <stdio.h>

int dice1;

int dice2;

int sum;

int roll_die_twice(int dice1,int dice2){

 

if(sum==7){

printf("winner");

 

}

else if (sum==11){

printf("looser");

}

else if (sum!=7 && sum!=11)

{

printf("nor winner or looser");

 

}

}

int main()

{

roll_die_twice(2,7);

return 0;

}

The code screenshot and code output can be seen in the attached image below.

6 0
3 years ago
Read 2 more answers
Can someone please help me out? I don't know what I'm supposed to print last...
aksik [14]

As stated in the instructions, you have to provide the math problem and the answer. Something like this:

print(a,"*",b,"=",answer)

All your other code seems to be correct. Hope this helps

8 0
3 years ago
Other questions:
  • One of the essential skills that software development engineers must have is the proficiency in at least one of the modern compu
    6·1 answer
  • Just giving this a shot, Which of the following statements about RAM are TRUE? Select all that apply.
    10·1 answer
  • Jason is an aspiring filmmaker. He manages finance and makes sure that everyone is involved in the project. Which role is Jason
    12·1 answer
  • How do you recognize the brand name of a drug in the package insert?
    15·1 answer
  • Space management is a<br> driving method.<br> A. lazy<br> B. defensive<br> C. fast
    14·1 answer
  • Read the section, "Junior Year." Why would someone chose to complete an apprenticeship after high school? How many occupations c
    14·2 answers
  • C++ "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the se
    12·1 answer
  • Green Fields Landscaping Company sells evergreen trees which are priced by height. Customers have a choice of purchasing a tree
    15·1 answer
  • Which of the following is not true?A. An organization may express its cybersecurity state through a Current Profile to report re
    10·1 answer
  • Which directory stores the cron configuration file?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!