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]
4 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]4 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
In the Remote Access Domain, if private data or confidential data is compromised remotely, you should set automatic blocking for
Alex787 [66]

Answer:

False

Explanation:

If your server has been hacked, accessed by Remote access domain, these are tips or recommendations:

- Disable the Remote Desktop service on the affected computer and close port 3389 on the router so that your server is not accessible by Remote Desktop from the Internet, as another hacker can re-access and encrypt more files or encrypt over those already encrypted. .

- Ensure that the virus is not active, to do this place some files to see if they are encrypted or not.

- Scan the server with an updated antivirus.

- Open Task Manager, view active processes, and end the encryption process, which is usually Payload.exe

- Change the passwords of all users of the computer.

- Install a good paid antivirus, we recommend these:

- Configure the antivirus with password protection, so hackers cannot uninstall or deactivate it.

- You can use a desktop blocking program such as Eusing Maze Lock.

- Use a network firewall and VPN connection to remotely access the computer.

- Never use direct connection by Remote Desktop without VPN.

- Set up an online backup or an appropriate backup policy.

6 0
3 years ago
Please help it’s timed
abruzzese [7]

Answer:

archetecture firm

Explanation:

government dont do that,

energy company arent engineers, and manufactures dont do specifically mapping techichian work

3 0
3 years ago
Which of the following is another type of brake system used in trucks
Doss [256]

answer is d hope it helps

4 0
3 years ago
It is a single strand of metal capable of transmitting power or data from one area to<br> another
Lera25 [3.4K]

Answer: A wire

Explanation:

8 0
3 years ago
4. A computer architect boasted that they were able to design a computer in which every instruction occupied exactly thirty-two
Mariana [72]

Answer:

Advantages include;

1. It would take up less space.

2. Programs may require far less memory to run.

3. Less power wastage

Explanation:

Advantages include;

1. It would take up less space.

2. Programs may require far less memory to run.

3. Less power wastage

6 0
3 years ago
Other questions:
  • Write a method void Print(int LastNumber, int numbersPerLine) that receives two integers
    15·1 answer
  • Assume you have a sorting algorithm that you can use as a black box. Use the sorting algorithm to sort the input list. Now write
    10·1 answer
  • Anne-Marie Cole runs the sales division for a local auto insurance firm. One of her key duties is to calculate her company's mar
    13·1 answer
  • Problem 3. Consider the following recurrence, defined for n a power of 4 (for the time of some algorithm): T(n) = 3 if n = 1 2T(
    5·1 answer
  • Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user wil
    13·1 answer
  • Suppose users share a 1-Gbps link. Also, suppose each user requires 200 Mbps when transmitting, but each user only transmits 30
    5·1 answer
  • The SPF strategy can be proven to be optimal in the sense that it minimizes average response times. In this problem, you will de
    10·1 answer
  • Which document outlines the activities carried out during testing?
    9·1 answer
  • The Carolina International School is more Earth-friendly than typical schools because
    7·1 answer
  • The Backstage view is where you can see information and options pertaining to the user account and settings. How is the Backstag
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!