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
WILL GIVE BRAINLIEST!! 20 PNTS!!
kirill [66]

Answer:

B :)

Explanation:

.........

3 0
2 years ago
Read 2 more answers
A = 250; B = 325. which of the following statements is true? A ==B A&gt;B A =B
Feliz [49]

Answer:

It should be A<B

Explanation:

250 is less than 325

5 0
2 years ago
PLEASE HELP!!! Me turn this into a video &amp; add liana flores- raise the moon (instrumental) in the background for the music.
Marina CMI [18]

Answer:

Try going to your settings and allow output camera

Explanation:

5 0
1 year ago
Read 2 more answers
Which standardized framework was developed by NIST to be used as a guidance document designed to help organizations assess and m
MariettaO [177]

The standardized framework developed by NIST to be used as a guidance document is;

NIST Special Publication (SP) 800-37 Risk Management Framework for Federal Information Systems and Organizations:

<h3>Computer Frameworks</h3>

The standardized framework by NIST from the FISMA guideline is the NIST Special Publication (SP) 800-37 Risk Management Framework for Federal Information Systems and Organizations.

Now, this standardized framework is simply a Life Cycle Approach used for Security and Privacy, and also it details the Risk Management Framework (RMF).

Read more about Computer Framework at; brainly.com/question/25236672

3 0
2 years ago
T.J. wants to send a friend a file with a funny dancing cat. Which file format should T.J. use?
masha68 [24]

Answer:

If it is a Gif, then T.J. should, obviously, use the GIF format, but I think the answer you're looking for is MP3, since that is generally (at least for me) what videos are sent as!

Hope this helps(:

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Network a0 is a process by which several protocols evolve to form a single product.
    7·1 answer
  • How to Save Power-Point presentation as a single file Web page that can be uploaded to the World Wide Web ?
    14·1 answer
  • How can you tell that you're driving in the right direction?
    14·1 answer
  • Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending whe
    5·2 answers
  • What is netbeans and what is it for??
    9·1 answer
  • Given an int variable k, an int array incompletes that has been declared and initialized, an int variable nIncompletes that cont
    6·1 answer
  • In the following code: function drawCircle(radius, x, y, color) { var circle = new Circle(radius); circle.setPosition(x, y); cir
    7·1 answer
  • A student can improve performance by decreasing
    14·1 answer
  • What is a computer please tell me ​
    10·2 answers
  • in the future, mobile technologies are expected to be used more than desktop computers today. what other improvements are helpin
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!