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
MaRussiya [10]
2 years ago
9

Use the arr field and mystery () method below.

Computers and Technology
1 answer:
kolezko [41]2 years ago
7 0

Answer:

The sum of all positive even values in arr

Explanation:

We have an array named arr holding int values

Inside the method mystery:

Two variables s1 and s2 are initialized as 0

A for loop is created iterating through the arr array. Inside the loop:

num is set to the ith position of the arr (num will hold the each value in arr)

Then, we have an if statement that checks if num is greater than 0 (if it is positive number) and if num mod 2 is equal to 0 (if it is an even number). If these conditions are satisfied, num will be added to the s1 (cumulative sum). If num is less than 0 (if it is a negative number), num will be added to the s2 (cumulative sum).

When the loop is done, the value of s1 and s2 is printed.

As you can see, s1 holds the sum of positive even values in the arr

You might be interested in
Before performing a Web Recorder task, which two options should the user ensure are setup correctly?
muminat

Answer: Automation can be done using a recoder. Recorders capture important details such as object, texts, images.They are basically three kinds of recorder; web, smart and screen

Explanation: before performing a web recorder task

1. Consider the licensing cost

2. The Smart technology

6 0
2 years ago
Read 2 more answers
A machine on a 10 Mbps network is regulated by a token bucket algorithm with a fill rate of 3 Mbps. The bucket is initially fill
ikadub [295]
2+4= this gbhfchgcjdxbhdch is correct
4 0
3 years ago
Someone gave me flashcards on a keychan. I have to memorize them and then give them back. Can I back them up to my PC by creatin
butalik [34]

Answer: Yup!

If you'd rather take a picture with your phone, just back transfer the photos into your computer if necessary.

5 0
3 years ago
Help me out with this .....
kykrilka [37]

Answer:

D

Explanation:

You are welcome

8 0
3 years ago
Give an example of an occasion when you used logic to solve a problem
netineya [11]
You can use it when like confirming a policy
8 0
3 years ago
Other questions:
  • What is process equipment?
    12·1 answer
  • What was the partition style(s prior windows server 2008 and windows vista?
    13·1 answer
  • At the beginning of this month, the balance of Reed's checking account was $692.35. So far this month, he has received a paychec
    13·2 answers
  • Write a MARIE program to allow the user to input 8 integers (positive, negative, or zero) and then find the smallest and the lar
    15·1 answer
  • Read the scenario below and then answer the
    14·1 answer
  • If you want to insert a column into an existing table, what would you do?
    13·2 answers
  • c724 wgu True or false. A storage device consists of all the components that work together to process data into useful informati
    10·1 answer
  • I really need this done Thank you!!
    6·1 answer
  • Vegetable farming is a good source of income explain this statement<br>​
    5·1 answer
  • Acciones de un lápiz
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!