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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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