Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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. 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

Write a research paper on History of Object Oriented Databases

Answered: 1 week ago

Question

Describe how to properly size a laundry.

Answered: 1 week ago

Question

2. How were various roles filled?

Answered: 1 week ago