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
Mademuasel [1]
2 years ago
14

Create a new class MyArray_DE and copy and paste the previous program. Be sure to rename the class to MyArray_DE. Modify the pro

gram so that it sums up only the even numbers. PART E. At the end of the program, write a FOR loop that prints the array in reverse (you are not reversing the array; you are simply printing it). Test your program with all the above test cases.
Computers and Technology
1 answer:
vova2212 [387]2 years ago
4 0

Answer:

public class MyArray_DE

{

public static void main(String[] args) {

    int[] numbers = {28, 7, 92, 0, 100, 77};

    int total = 0;

    for (int i=0; i<numbers.length; i++){

        if(numbers[i] % 2 == 0)

            total += numbers[i];

    }

 System.out.println("The sum of even numbers is " + total);

 System.out.println("The numbers in reverse is ");

 for (int i=numbers.length-1; i>=0; i--){

        System.out.print(numbers[i] + " ");

    }

}

}

Explanation:

Since you did not provide the previous code, so I initialized an array named numbers

Initialize the total as 0

Create a for loop that iterates through the numbers

Inside the loop, if the number % 2 is equal to 0 (That means it is an even number), add the number to total (cumulative sum)

When the loop is done, print the total

Create another for loop that iterates through the numbers array and print the numbers in reverse order. Note that to print the numbers in reverse order, start the i from the last index of the array and decrease it until it reaches 0.

You might be interested in
What type of protocol provides a way to transfer files from one computer to another over tcp/ip such as lan?
leva [86]
FTP provides this functionality.
5 0
3 years ago
In database systems, the dbms enforces rules about which user can perform which action when. The rules are known as ________.
saw5 [17]

I guess the correct answer is concurrency control

Cοncurrеncy cοntrοl is a databasе managеmеnt systеms (DBMS) cοncеpt that is usеd tο addrеss cοnflicts with thе simultanеοus accеssing οr altеring οf data that can οccur with a multi-usеr systеm.

In database systems, the DBMS enforces rules about which user can perform which action when. The rules are known as concurrency control.

6 0
3 years ago
In an advertisement, a speed specification, such as 2.66 ghz, indicates the speed of the microprocessor?
Ray Of Light [21]

Answer:

yes / true

Explanation:

it is one of the factors in determining the speed of the microprocessor

5 0
1 year ago
Which part of the Word application window should the user go to for the following activities?
garri49 [273]

<u>Answer:</u>

<u>Correct</u>

<u>Explanation:</u>

Indeed, the world application is a word processing software used by many professionals and students alike.

Read a document: To do this, the user should go to the document area  found at the top left corner of the tool bar.

Find the name of the document: By looking at the Title bar.

Change the way a document is viewed: The Ribbon area is located at the top right section of the screen near the minimize icon.

Find help to do a certain activity on word: Close to the Ribbon area there is a dialog box having the image of a bulb.

Go up and down to different parts of a document: By going to the scroll bar which found at the extreme right hand side (margin) of the page.

Determine the page number of the document: By going to the Status bar found at the bottom right of the page.

3 0
3 years ago
Which binary number is the greatest?<br> 11011<br> 11001<br> 11100<br> 11010<br> 11000
Masteriza [31]

Answer:

the third one

Explanation:

the rest is below 28 apart from the third one which is 28 and is the most

3 0
3 years ago
Other questions:
  • You are able to change the formatting of a table after it is inserted into a placeholder. True or false
    9·2 answers
  • Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime
    12·1 answer
  • What type of malicious procedure involves using sniffing tools to capture network communications to intercept confidential infor
    7·1 answer
  • All but one of the following statements about stored procedures is true. Which one is false? a. They consist of one or more SQL
    10·1 answer
  • To move from layout view to form view, tap or click the _____ button on the access status bar.
    15·1 answer
  • How to upgrade from office home to office professional
    13·1 answer
  • Optimizing a network to handle more traffic by adding new specialized software is an example of ______ scaling. Adding additiona
    9·1 answer
  • Translate each statement into a logical expression. Then negate the expression by adding a negation operation to the beginning o
    15·1 answer
  • Impaired drivers are one of the many risks drivers face on the Highway Transportation System. List 3 signs that a driver could b
    10·2 answers
  • Question 1
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!