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
lapo4ka [179]
4 years ago
13

Write a method that take an integer array as a parameter and returns the sum of positive odd numbers and sum of positive even nu

mbers.
Computers and Technology
1 answer:
elixir [45]4 years ago
6 0

Answer:

I will code in Javascript:

function sumOddAndEven(){

<em> //Define and initialize variables.</em>

var numbers = [1,2,3,4,5,6,7,8];

var sum = [0,0];

for ( var i = 0;  i < numbers.length ; i++ ){  <em>// loop to go throght the numbers</em>

<em> </em>if(numbers[i] > 0) {<em> // if the number is positive</em>

  if(numbers[i]%2 == 0) {  <em>// if number is even and </em>

     sum[0] = sum[0] + numbers[i];  <em>//adds in the first place of sum</em>

   }

   else{  

     sum[1] = sum[1] + numbers[i];  <em>// else adds in the second place of sum</em>

   }

 }

}

 return sum; <em>//return an array with the sum of the positive evens numbers  in the first place and the sum of the positive odd numbers in the second place.</em>

}  

You might be interested in
What does Pentium means?:/
netineya [11]
Pentium is just a brand of a CPU chips from Intel that is usually in your laptops or chromebooks. It's used for general purpose computing. Produced by Intel since 1993. 
4 0
3 years ago
Read 2 more answers
Which statement below is inaccurate? a. Web 2.0 is a simple static website without any interaction with its users b. Web 2.0 bri
arsen [322]

Web 2.0 is a simple static website without any interaction with its users is inaccurate. This statement is accurate in web 1.0 and not 2.0

Further Explanation:

Web 1.0 is considered as the read-only web and represents the 1st implementation of the WWW. It allowed users to look for information online without offering an opportunity to fully interact with its pages. You only got the opportunity to passively read the content and that was it. The pages were static and were sometimes hosted on a free web hosting service.

Web 2.0 offers an interaction with its users. It is the read-write web technology as Berners-Lee would put it and it offers interoperability to its clients. It is what we interact with so much in our day-to-day lives. Examples of web 2.0 are the Wiki, FB, Twitter, and many more. These examples shows us how web 2.0 brings people closer together with information using machines and encourages participation and sharing of information.

Web 3.0 is not commonly used and is known to may as the future web. It is what many refer to as “IOT” or the semantic web. The world is slowly trying to transition into web 3.0 with smart devices trying to connect to the internet. It is trying to alter the web that humans are familiar with into some sort of database. It the web for the foreseeable future.

Learn more about web 2.0

brainly.com/question/10313994

#LearnWithBrainly

7 0
3 years ago
7. Suppose that a RISC machine uses 5 register windows. a. How deep can the procedure calls go before registers must be saved in
Semenov [28]

Answer:

bbbbbbbbbbbbnbbnnnnnnnnnnnnnnnnn

6 0
2 years ago
What characteristics that a graphic designer should possess?​
mart [117]

Graphic design qualities that will help you succeed

Active listening. Graphic designers aren't solo artists who work in solitude to create whatever they want. ...

Clear and concise communication. ...

Time management. ...

The ability to accept constructive criticism in stride. ...

Patience. ...

Storytelling ability.

4 0
3 years ago
Read 2 more answers
Which option is NOT in the Link to portion of the Insert Hyperlink dialog box?
WARRIOR [948]
Existing file or webpage
4 0
4 years ago
Read 2 more answers
Other questions:
  • What is the only language a microprocessor can process directly but most programmers almost never write programs in this code? Q
    12·2 answers
  • You knew that you had to take this quiz so you logged into Blackboard and went to the quizzes section. In this scenario your com
    11·1 answer
  • Which of the following are provided by most
    5·1 answer
  • What are the benefits of transferable skills check all the boxes that apply
    6·2 answers
  • MARKETING HELP PLEASE?!?!?
    15·1 answer
  • Look at these examples:- • Men are not emotional. • Women are too emotional. • Jewish people are good business people. • The Fre
    12·1 answer
  • Let f(w) = 2w^3 - 5. Let z = 2. What is f(z)?​
    6·1 answer
  • Suppose we want an error correcting code that will allow all single-bit errors to be corrected for memory words of length 15. 1.
    5·1 answer
  • Ang Kabihasnang ito ay umusbong sa rehiyon ng Timog Mexico
    6·1 answer
  • Components of document merging?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!