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
egoroff_w [7]
3 years ago
12

Answer the following questions concerning Arrays and write down the corresponding Java statements. Please type in the answers he

re and submit them on Canvas. Declare and instantiate an array called myExams to hold 4 exam scores. The exam scores will be floating-point numbers (double). After declaring array myExams, each element of the array has what value in it? Now, load the following exam scores into your existing array. 92.3 82.0 98.4 91.0 Display the 2nd component of myExams using System.out.println? What are you expecting to be displayed with the above statement? Display all of the components of your array using System.out.println in a for loop. Add up all of the exam scores in your array and store the total in a double variable called sum. This will be another for loop! Explain array bounds checking. What happens when an invalid index is used for an array? Display all of the components of your array using for each loop also called an enhanced for loop.
Computers and Technology
1 answer:
vladimir1956 [14]3 years ago
6 0

Answer:

Check the explanation

Explanation:

(1)

class Brainlyarray{  

public static void main(String args[]){  

double myExams[]=new double[4]; //declaration & instantiation  

(2)

Each index of the array myExams have a garbage value stored on it's every index as at this point only the array is declared but not initialized the indexes are not holding any value yet.

(3)

myExams[0]=92.3; //initialization  

myExams[1]=82.0; //initialization

myExams[2]=98.4;  //initialization

myExams[3]=91.0;    //initialization

(4)

System.out.println(myExams[1]); // Will Print the 2nd component of the array

(5)

It will print the 2nd index of the 1D array myExams and the value which will be printed on the screen is 82.0

(6)

for(int i=0;i<myExams.length;i++) // length is the size of this 1D array and in this for loop this loop will run till the end of the length of the array which means till the size of the array.

System.out.println(myExams[i]);  

(7)

double sum=0.0; // Delaration of the sum variable

for(double num : myExams){ //For loop here num is the storage container where all the elements of the array myExams are been stored

sum=sum+num;

}

(8)

Array Bound Checking is basically the process in which it is being ensured that the value that is been entered is meeting the array boundaries or not as the array index value should be equal or greater than zero and less or equal to the size of the array.

and if we enter an invalid index value so it will be throwing an exception in thread of the main.

(9)

for ( double value : myExams){ //for each loop (Enhanced for loop )

System.out.println(myExams);

}

////////////////////////////////////////////////////////////////////////////////

You might be interested in
What's a good app that solves trigonometry problems?
Minchanka [31]
Trig solver. I hope this helped
5 0
3 years ago
Why operating system is pivotal in teaching and learning
trasher [3.6K]

Answer:

Without it information flow is impossible

Explanation:

The word 'pivotal' also means crucial or vital, and so we need to consider what an operating system actually does.

Remember, merely having all the hardware of a computer would not allow you to run (install and use) programs. It is by means of an operating system that teaching programs can be installed, and it is also by means of an operating system learning can take place.

For example, a student can decode (learn) instructions/lessons from his teacher via a software program; and the software program needs an operating system to open (run) the program.

6 0
3 years ago
Which of the following is an example of a federal tax? A. Social Security tax B. Sales tax C. Property tax D. Transaction tax
Nastasia [14]
Property tax should be the correct answer
6 0
3 years ago
What is a correlation and how does it relate to inferential error?
riadik2000 [5.3K]
A correlation is a consistent relationship between two or more variables. It relates to our tendency to draw causation from mere correlation.
5 0
3 years ago
Digital manufacturing has impacted our world today! List a reasons why.
Maru [420]
Because we can get manufacturing faster than usual
6 0
3 years ago
Other questions:
  • I want to work on cloud computing and i need some help on how to start ?
    6·1 answer
  • A cooler with heat pipes, which contain a small amount of liquid that becomes a vapor when heated, allowing heat to be drawn awa
    10·1 answer
  • Which method deletes a footer from a document?
    13·2 answers
  • What is a strictly layered pattern, provide an example of its usage.
    13·1 answer
  • To support continuous improvement efforts in the workplace, you increase the number of tasks that an employee performs and have
    7·1 answer
  • In the writing and language test of the SAT, questions ask students to do which of the following? A. Write an essay B. Define a
    14·2 answers
  • A noisy signal has been uploaded to D2L in the files fft_signal.mat and fft_signal.txt.Write a program to estimate the power spe
    10·1 answer
  • interpret the following SQL create table persons (person I'd int, last name varchar (255) first name varchar (255) address varch
    7·1 answer
  • In which of the following phases of filmmaking would a production team be focused on the
    10·2 answers
  • Assessment
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!