Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program (One class with a main method) to do the following: 1. Ask the user to enter an integer (n) 2.

 Write a Java program (One class with a main method) to do the following: 1. Ask the user to enter an integer  

Write a Java program (One class with a main method) to do the following: 1. Ask the user to enter an integer (n) 2. Declare an array of size n with double data type. 3. Ask the user to enter the values of the array. 4. Create another array with of size n with integer data type. 5. Make a copy of the first array to the second array but in reverse order (e.g., the last element in the first array should be store in the first element in the second array and so on). 6. Output values stored in the two arrays. 7. Find and output how many odd values in both arrays are equal based on the index number, i.e. count matching values of two arrays based on same index value AND the element value of the array. Sample Input/output Enter n:4 Enter array values: 1234 First Array:1 234 Second Array:4 3 21 # of Equal values = 0 Enter n:5 Enter array values: 12345 First Array:1 2345 Second Array:5 4 321 # of Equal values = 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Certainly Based on the requirements from the image below is a sample Java program that performs the ... 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

College Algebra

Authors: Margaret L. Lial, John Hornsby, David I. Schneider, Callie Daniels

12th edition

134697022, 9780134313795 , 978-0134697024

More Books

Students also viewed these Programming questions

Question

What is the Antebellum Interregional growth hypothesis?

Answered: 1 week ago

Question

What is the use of bootstrap program?

Answered: 1 week ago

Question

What is a process and process table?

Answered: 1 week ago

Question

What is Industrial Economics and Theory of Firm?

Answered: 1 week ago

Question

Evaluate the expression for p = -4, q = 8, and r = -10. 3 4 00

Answered: 1 week ago

Question

What are the advantages and disadvantages of Agile PM?

Answered: 1 week ago