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

  Describe practice to employ to mitigate malware effects

Describe the best practice to employ to mitigate malware effects on a machine. Write the discussion in 300 words, APA format, no plagarism, Provide references.

  Questionevery spring you looking forward to buying a box of

questionevery spring you looking forward to buying a box of caramel delites girl scout cookies.the troop provides an

  Determine the forced motion velocity

Consider a 5-m-long vertical plate at 60°C in water at 25°C. Determine the forced motion velocity above which natural convection heat transfer.

  What would be the impact of predictive modeling

What would be the impact of predictive modeling on healthcare and medicine? Can predictive modeling replace managerial or medical personnel?

  E-commerce transaction

Question 1: Suspicious e-commerce transaction includes orders placed by a customer in one country that are shipped to another country. In fact there are no such orders in the Northwind db,  so create a few by modifying some of the "Germany

  What is meant by the functional decomposition

Describe what is meant by the functional decomposition of a Boolean function of n variables and discuss procedures for decomposing Boolean functions.

  Use a bubble sort algorithm in c++

use a Bubble Sort algorithm in C++ that generates a list of 10 random integers.

  What addressing information about p2 is necessary for p1

Suppose user process (application) P1 of one computer wishes to transfer data (file) to process (application) P2 on another computer in the Internet.

  Question1 assume that a file containing a series of

question1. assume that a file containing a series of integers is named number.dat and exists on the computers disk.

  Explain in brief the meaning of line with visi technology

Problem Explain in brief the meaning and significance of line with VISI technology. What are the various line widths currency being used?

  Prompt the user for three sentences of text

Prompt the user for 3 sentences of text. Pass these pieces of text into a function connect() which will connect all three sentences into one long sentence.

  Draw a dfa that recognizes language l

Consider language L equal to the set of strings on the alphabet {a, b} such that the final symbol in the string has not appeared earlier in the string.

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