Write a java program that reads a list of 25 values

Assignment Help Computer Engineering
Reference no: EM132201075

Write a JAVA program that reads a list of 25 values from the user. Put the values in an array.

The program should read the array and then calculate and display the average of the even input values and the average of the odd input values.

Consideration: You should have a class and a tester. In the class, you will have three instance variable,

1) an array to hold the numbers,

2) a double to hold the odd average and a double to hold the even average.

The constructor should accept as input the array from the tester class and assign it to the instant variable; it should also assign 0 to the even and odd average variables.

You should then have a method that will read the array and then calculate the average of the even input values and the average of the odd input values.

Your program will need a getOddAverage and a getEvenAverage method. The tester class will ask the user to input numbers (consider partially filled as well).

It will then create an object passing the filled array to the class. The tester should then call the calculate the averages method. You will then need to print the even and odd average.

Reference no: EM132201075

Questions Cloud

Suppose that the distribution of ages of cars : Suppose that the distribution of ages of cars is approximately normal with a standard deviation of 3. Find the % of cars that are between 5 and 8 years old
Write a program to output the digits 0-9 to the command line : Write a Java program to read a string (a password) from the user at the command line and then check that the password conforms to the corporate password policy.
How about compared to the federal minimum wage : Jerry works at Jamba Juice and gets paid California state minimum wage. However, in the 1970s, the minimum wage was $1.60 per hour.
Dependent and independent variables : Can it be done for categorical data? Using scholarly citations, differentiate regression analysis for quantitative vs. categorical data.
Write a java program that reads a list of 25 values : The program should read the array and then calculate and display the average of the even input values and the average of the odd input values.
Hat is the probability that you would pick an edge piece : Assuming the first piece you picked is not replaced, what is the probability that you would pick an edge piece?
What themes and topics stood out to you : Briefly, what is the main plot? (1-2 sentences). (No need to tell me the whole story; I've seen it.) What themes and topics stood out to you?
Chances of getting the ring around a bottle : If there are 12 bottles of sprite, 10 bottles of coke, and 8 bottles of rootbeer; what are the chances of getting the ring around a bottle of coke
Difference between the standard deviation of a hypothesis : What is the Difference between the standard deviation of a hypothesis test that uses critical value and a hypothesis test that uses p values?

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is the difference between a sequential control

post a 200 to 300-word response to each of the the following question1. what is the difference between a sequential

  For the arithmetic expressions below draw a binary tree

question for the arithmetic expressions below draw a binary tree that represents the expression and then use tree

  Describe the main purpose of prototyping describe why a

question a. explain the main purpose of prototyping.question b. explain why a prototype might or might not evolve into

  Give some of the major threats to information systems

What will happen if that information were compromised? What are some of the main threats to information systems? Provide three examples to support your answer.

  Octal and binary the mayan number

Convert to base hex, decimal, octal and binary the Mayan number (base 20) J7GE.I8H (all done in arithmetic in decimal)

  Define a flowchart and a pseudocode for the program

After designing the class, design a program that creates an object of the class and prompts the user to enter the name, type, and age of his pet. This data must be stored in the object. Use object's accessor methods to retrieve the pet's name, typ..

  Identify all the actors that will be using the system

Recall the On the Spot courier service introduced in Unit 1. The details of the package pickup and delivery process are described here.

  Explain the frame format of a typical ethernet packet

Explain how carrier sense multiple access with collision detection (CSMA/CD) works.

  Write a bash shell script that prompts you for a user

Write a Bash shell script that prompts you for a user login name and displays all other users in the same group of this user.

  Define the image as a matrix a using the imread function

Define the image as a matrix a using the imread function. What is the height and width in pixels?

  Discuss the united states hold in this security environment

the most important advantages and deficits the united states hold in this security environment

  How could you create more full featured double dutch

What if you include punctuation like periods or hyphens? How could you create more full featured double dutch that gets around these problems?

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