Write a Java program (One class with a main method) to do the following: 1. Ask...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
Certainly Based on the requirements from the image below is a sample Java program that performs the ... View the full answer
Related Book For
College Algebra
ISBN: 978-0134697024
12th edition
Authors: Margaret L. Lial, John Hornsby, David I. Schneider, Callie Daniels
Posted Date:
Students also viewed these programming questions
-
What is the price of the following bond? Face Value: $1,000 YTM (Yield of comparable bonds): 8% Coupon: 8% Maturity: 8 years Round your answer to the nearest two decimals. Do not type the $ symbol.
-
Moran owns a building he bought during year 0 for $237,000. He sold the building in year 6. During the time he held the building, he depreciated it by $33,250. What are the amount and character of...
-
Explain how the results would suggest you invest funds for the following goals, purchasing a home in seven years and for retiring in 35 years. Indicate the asset allocation you would use for each of...
-
What is the Antebellum Interregional growth hypothesis?
-
Ratliff Development Corporation purchases a tract of land in 2014 at a cost of $120,000 and subdivides the land into 30 building lots. The cost of subdividing is $6,000. In 2014, Ratliff installs...
-
A wealthy businessman wants to start a permanent fund for supporting research directed toward sustainability. The donor plans to give equal amounts of money for each of the next 5 years, plus one now...
-
Which would not be a detective control? a. Drug testing b. Reconciliations c. Surprise cash counts d. Counting inventory e. Reviews
-
Selected transactions for Essex Company during July of the current year are listed in Problem 5-3B. In Problem 5-3B. The following were selected from among the transactions completed by Essex Company...
-
A database has four transactions . Let min sup = 60 % and min conf = 80 %. TID Date Items_ bought 10/15 /19 {K, A,D,B ) 10/15 /19 [D,A, C.E.B) 300 10 /19 /19 {C,A, B, E } 400 10/22 /19 {B,A,D} (a)...
-
WorldCom revealed that in addition to the US$3.8bn in expenses improperly recorded as capital, an internal audit discovered that US$3.3bn in profits were improperly recorded on its books from 1999 to...
-
L09 Budget Report Assignment Directions Objectives For the purpose of this lesson's assignment, you will create a basic variance report. You will use the information provided in the assignment...
-
How do environmental factors, such as pollutants and climate change, impact ecological systems at the molecular and organismal levels, and what are the potential implications for biodiversity and...
-
c. What is the maximum amount your fund can invest? (2 marks) d. Given the investment in (c), what percentage ownership of Shazam would your fund own at the conclusion of the second round of...
-
What innovations account for the rapid growth in the variety of fixed-income instruments over the last 50 years? Aside from changes in the general level of interest rates, what is the primary source...
-
Master Paint Industries' sales in 2019 were $18 million, while in 2017 they were $10 million. Determine the sales growth rate. (4 points) 10. Determine the present value of a $3,500 perpetuity if the...
-
What are the molecular mechanisms underlying cellular senescence and aging, and how do they intersect with processes such as DNA damage repair, telomere maintenance, and mitochondrial dysfunction ?
-
, reexamine the steps for improvement of high reliability which you suggested for your organization. Would you change your recommendations in light of what you have learned in this course? Could your...
-
Identify the tax issues or problems suggested by the following situations. State each issue as a question. Jennifer did not file a tax return for 2007 because she honestly believed that no tax was...
-
Solve the system in terms of the specified arbitrary variable. 3x - 4y + z = 2 2x + y = 1 (x arbitrary)
-
Find the indicated term or terms of the expansion. Seventh term of (m - 3n) 14
-
Evaluate the expression for p = -4, q = 8, and r = -10. 3 4 00
-
7. ETHICS Jane says to Cody, "If you will agree to work as my yard man, I'll pay you $1,000 per week for a normal work week. You can start on Monday, and I'll guarantee you eight months' work." Cody...
-
8. Ronald Armstead worked for First American Bank as a courier. His duties included making deliveries between the bank's branches in Washington, D.C. Armstead parked the bank's station wagon near the...
-
9. YOU BE THE JUDGE WRITING PROBLEM Eileen Murphy often cared for her elderly neighbor, Thomas Kenney. He paid her $25 per day for her help and once gave her a bank certificate of deposit worth...
Study smarter with the SolutionInn App