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
he function below takes one parameter: a list of strings (string_list). Complete the function to return a new list containing on
Aleks04 [339]

Answer:

def select_short_strings(string_list):

   new_list = []

   

   for s in string_list:

       if len(s) < 20:

           new_list.append(s)

   return new_list

   

lst = ["apple", "I am learning Python and it is fun!", "I love programming, it is easy", "orange"]

print(select_short_strings(lst))

Explanation:

- Create a function called <em>select_short_strings</em> that takes one argument <em>string_list</em>

Inside the function:

- Initialize an empty list to hold the strings that are less than 20

- Inside the loop, check the strings inside <em>string_list</em> has a length that is smaller than 20. If found one, put it to the <em>new_list</em>.

- When the loop is done, return the <em>new_list</em>

- Create a list to check and call the function

4 0
3 years ago
Read 2 more answers
question 7 packages installed in rstudio are called from cran. cran is an online archive with r packages and other r-related res
Ksenya-84 [330]

Packages installed in rstudio are called from cran. cran is an online archive with r packages and other r-related resources, is the true statement.

<h3>What are CRAN packages in R?</h3>

It comprises archives for both the most recent and prior versions of the R distribution, donated R packages, and documentation. It provides both source packages and pre-compiled binaries for Windows and macOS. there are more than 16,000 bundles available.

The version of R that is made available through CRAN is compatible with the integrated development environment for R, referred to as RStudio. All of the major systems support RStudio, which includes a variety of tools that boost productivity.

Thus, it is the true statement.

For more information about CRAN packages in R, click here:

brainly.com/question/10658169

#SPJ1

7 0
1 year ago
Which chart element provides the boundaries of the graphic?
Eddi Din [679]
The correct option is B.
Chart area is the boundary that contains all the chart and all its elements including the chart titles, legends, plot area, labels, etc.
The legend is the key that identifies the gradient, texture, colour and pattern fill given to each data series. 
The chart title is the label that describe the chart while the plot area is the section of the chart that contains graphical representation of the values in a data series.
7 0
3 years ago
Read 2 more answers
Which of the following, when used in conjunction with hyperlinks, can be useful for easily navigating a Word document? : *
Valentin [98]
Caption is a best answer i hope its work
7 0
3 years ago
A​ _______ variable is a variable that has a single numerical​ value, determined by​ chance, for each outcome of a procedure.
7nadin3 [17]
Single variable is the answer
5 0
3 years ago
Other questions:
  • True or False: You cannot change the default margin size for Word documents.  
    6·1 answer
  • Subscribe to epic beast brothers thank you
    7·1 answer
  • Why is it important to protect people's intellectual property online?
    10·1 answer
  • To speed up item insertion and deletion in a data set, use ____.
    12·1 answer
  • HELP 99PTS If Answered
    12·2 answers
  • Fill in the blank with the correct response.
    5·2 answers
  • Es la actividad que posibilita comunicar gráficamente ideas, hechos y valores procesados y sintetizados en términos de forma y c
    11·1 answer
  • Question 1 (1 point)
    5·2 answers
  • Can someone pls do a toradora,Mha or princess jellyfish rp I'm open for anyother rp's
    11·2 answers
  • You have been asked to analyze the Excel data provided by your IT department. You would like to have the ability to sort and fil
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!