Compute the summation of even numbers and odd numbers

Assignment Help Computer Engineering
Reference no: EM132200766

Write java code for the following questions:

1. Create an ArrayList name it myArray that represents following numbers. {26, 10, 3, 0, 7, 9}

2. Compute the summation of even numbers and odd numbers from myNums and name them evenSum and oddSum. Hint1: you can use % to check if a number is even. Hint2: you can use enhanced for-loop.

3. Add evenSum and oddSum in myArray.

4. Sort the myArray and display to output.

5. Use for loop to replace even numbers with 0 (zero) and odds with 1.

Reference no: EM132200766

Questions Cloud

Which of the following statements is true of linux : Which of the following statements is true of Linux?
What is sonia total effective budget in dollars : Let the market price initially be that one hour of phone banking and one hour of canvasing can each be bought or sold for $10.
Display the date and a message : Write a Java console application that reads a string from the keyboard and tests whether it contains a valid date.
What does the coase theorem say about the case : What does the Coase theorem say about the case in which player 1 isnot liable for damages? Specifically, how does output compare to part (c)?
Compute the summation of even numbers and odd numbers : Compute the summation of even numbers and odd numbers from myNums and name them evenSum and oddSum.
Write a java boolean method which takes a 2-d array : Write a Java boolean method, equalRowCol, which takes a 2-dimensional array of int as a parameter and returns true if there is an entry.
What is the path between 0 and 5 : What is the path between 0 and 5? What is the weight of the path between 0 and 5?
What promotional mix has been used in the imc campaign : Describe the big idea, or brand message, underpinning the integrated marketing communications (IMC) campaign that has been developed for this brand.
Create another object called b2 without passing parameters : Write a Java class called BankAccount (Parts of the code is given below), which has two fields name (String) and balance (double), two constructors.

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  What is wardriving

Give a summary (of at least one-page) covering what networking technologies are involved in Wardriving and potential problems caused by Wardriving.

  Recognizing the error in code

Suppose that the variable A is an arrays of ints. Take the following code segment:Boolean flag = false;

  Write a complete program that asks the user for a seed

Write a complete program that asks the user for a seed and then outputs a list of ten random numbers based on that seed.

  To what percent of its normal speed is the computer reduced

To what percent of its normal speed is the computer reduced during a DMA transfer if each 32-bit DMA transfer takes one bus cycle?

  How can you sort array of country objects by increasing area

How can you sort an array of Country objects by increasing area? Can you use the Arrays.sort method to sort an array of String objects?

  Develop a table that relates number of people

Develop a table that relates number of people to project duration for a software project requiring 50,000 LOC and 15 person-years of effort (the productivity parameter is 5000 and B 0.37).

  Prepare a web page that lists at least five useful resources

Prepare a Web page that lists at least five useful resources along with information about each that provides the name of the site, the URL, a brief description.

  Determine which company the customer could buy each item

Design a polynomial time algorithm to determine which company the customer could buy each item from to minimize her total cost.

  Write an algorithm to decide which commute is cheaper

You want to decide whether you should drive your car to work or take the train. Write an algorithm to decide which commute is cheaper.

  How to execute a script with the lowest cpu priority

Please give me a one liner on how to execute a script with the lowest cpu priority, Using the command "nice"

  Question 2 consider the sample space s a b c d and a

question 2 consider the sample space s a b c d and a probability function pr s mdashgt ir on s. define the events a a

  Explain when you need to create a branch delta

Explain when you need to create a branch delta. Is 1.2.1 a branch delta? Mention three advantages CVS has over RCS.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd