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
John works as a sales representative with Northwind Traders. He has to make a presentation to his customers in another town. The
Sphinxa [80]

Answer:

Laptop.

Explanation:

In the following scenario, John works in the company as the sales representative and he creates a presentation for his users who belongs to another town. The following presentation contains 10GB storage and he also modifying his presentation at the time of traveling.

So, It is clear that he is not using the Mainframe, PDA, or any other desktop computer, he will using his Laptop.

8 0
2 years ago
For each of the innovations below. Decide if it is a computing innovation or not. Part 3 Continued.
stira [4]

Explanation:

a table of the chemical elements arranged in order of atomic number, usually in rows, so that elements with similar atomic structure (and hence similar chemical properties) appear in vertical columns.

6 0
2 years ago
HELP
Marrrta [24]
I’m pretty sure the answer is b
8 0
2 years ago
Which device performs the function of determining the path that messages should take through internetworks?.
bija089 [108]

Answer:

A router

Explanation:

8 0
2 years ago
Do you believe that OOP should be phased out and we should start working on some alternative(s)? Provide your answer with Yes or
o-na [289]

Answer:

I don't think so. In today's computer era, many different solution directions exist for any given problem. Where OOP used to be the doctrine of choice, now you would consider it only when the problem at hand fits an object-oriented solution.

Reason 1: When your problem can be decomposed in many different classes with each many instances, that expose complex interactions, then an OO modeling is justified. These problems typically produce messy results in other paradigms.

Reason 2: The use of OO design patterns provides a standardized approach to problems, making a solution understandable not only for the creator, but also for the maintainer of code. There are many OO design patterns.

5 0
3 years ago
Other questions:
  • Jake is photographing his pet puppy. He wants to preview the image the camera will capture. What part of the camera that is insi
    6·2 answers
  • WILL GIVE BRAINLIEST PLEASE HELP / urgent
    9·1 answer
  • USB keys can store terabytes of data. Of the five key factors that contribute to the increasing vulnerability of organizational
    13·1 answer
  • Christine wants to send a quick communication to all department managers. She should send a _____. report
    13·2 answers
  • *FREE POINTS* If you comment and follow me this will give up lot of points :p seriously I will follow u back if u do it :p​
    11·2 answers
  • What is the recommended point size for a slide title?<br> 12–22<br> 24–40<br> 44–66<br> 54–80
    6·1 answer
  • When browsing using certain browsers, if a page is known to be malicious or using phishing techniques in the past a browser may
    5·1 answer
  • What is faster C++ or go lang
    15·1 answer
  • Match the feature to its function.
    7·1 answer
  • Question 1 (True/False Worth 3 points)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!