Write a Java program to do the following: 1. Promote the user enter the size of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program to do the following: 1. Promote the user enter the size of the array. 2. Create an array named list to hold integer values. 3. Prompt the user to enter value of the array. 4. Ask the user to enter an integer x. 5. Count the numbers of occurrence of x in the list. 6. Print on Screen all odd numbers in the list less than x. Example: Enter size of the list: 10 Enter 10 values: 1 2 3 -4 -5 3-1 3 9 13 Output: Enter x: 3 3 repeated 3 times in the list. Odd numbers <3 are: 1,-5, -1 Write a Java program to do the following: 1. Promote the user enter the size of the array. 2. Create an array named list to hold integer values. 3. Prompt the user to enter value of the array. 4. Ask the user to enter an integer x. 5. Count the numbers of occurrence of x in the list. 6. Print on Screen all odd numbers in the list less than x. Example: Enter size of the list: 10 Enter 10 values: 1 2 3 -4 -5 3-1 3 9 13 Output: Enter x: 3 3 repeated 3 times in the list. Odd numbers <3 are: 1,-5, -1
Expert Answer:
Answer rating: 100% (QA)
Heres a Java program that accomplishes these tasks java import javautilScanner public class ArrayOpe... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The code that you add to the Craps main method needs to do the following steps in the following order (where indicated by the comments in the code itself): 1. Declare an integer array named counts...
-
You have now been asked to work with a textile startup business that your firm has just taken on as a client. The business is particularly in need of support and guidance with budgeting and how it...
-
Comprehensive variance analysis review. Sonnet Inc. has the following budgeted standards for the month of March 2010: Sales of 2,000,000 units are budgeted for March. Actual March results are: Unit...
-
Estimate how long an AM antenna would have to be if it were. (a) or. (b) . AM radio is roughly 1 MHz (530 kHz to 1.7 MHz).
-
Lakonishok Equipment has an investment opportunity in Europe. The project costs 15 million and is expected to produce cash flows of 2.9 million in year 1, 4.2 million in year 2, and 4.5 million in...
-
What are some of the nonverbal clues to deception?
-
Felicia Rashad Corporation has pretax financial income (or loss) equal to taxable income (or loss) from 2000 through 2008 as follows. Pretax financial income (loss) and taxable income (loss) were the...
-
(5) A small maintenance project consists of the following jobs whose precedence relationships are given below: Job 1-2 1-3 2-3 2-5 3-4 Immediate Predecessor 15 15 3 5 8 8 Activity 3-6 4-5 4-6 5-6 6-7...
-
The New Economy Transport Company (NETCO) was formed in 1959 to carry cargo and passengers between ports in the Pacific Northwest and Alaska By 2018, its fleet had grown to four vessels, including a...
-
Consider the i-node shown in Figure. If it contains 10 direct addresses and these were 8 bytes each and all disk blocks were 1024 KB, what would the largest possible file be? Figure. An example...
-
In the case of a voluntary import restriction, neoclassical trade theory predicts a loss of welfare for the home country. Why are some governments nevertheless pushing their trade partners into...
-
Describe the history related to the codification of Section 381(c)(2) - what court cases were on topic and what did they say?
-
Problem 3 (4 pts). A nonionic organic molecule "A" is dissolving and diffusing into a pure carrier solvent "B," which is flowing with a certain velocity across a flat surface of pure A. The...
-
What importance does tax planning provide during a sale or acquisition of another company, and specifically what income tax consequences are at issue?Does it make a difference whether the acquisition...
-
Giving local own source revenues will only increase horizontal inequality between local government administrations. Big local governments will get richer and the smaller local governments will remain...
-
How can a clinician differentiate between delusions and odd beliefs that are not pathological?
-
Calculate the number of neutrons of 239Pu.
-
Mad Libs is a childrens game in which they provide a few words that are then incorporated into a silly story. The game helps children understand different parts of speech because they are asked to...
-
The chief disadvantage to using the ArrayList class instead of the Arrays class is that an ArrayList ____________. a. Cannot be sorted b. Cannot store primitive data types c. Cannot be accessed using...
-
Which of the following cannot be specified in any version of the jtextfield constructor? A. The initial text in the field B. Requiring that the value entered be nonnumeric C. The number of columns in...
-
Using an economic balance sheet, which of the Laws current financial assets is most concerning from an asset allocation perspective? A. Equities B. Real estate C. Fixed income Raye uses a costbenefit...
-
Using the economic balance sheet approach, the Laws economic net worth is closest to: A. $925,000. B. $1,425,000. C. $1,675,000. Raye uses a costbenefit approach to rebalancing and recommends that...
-
Raye believes the previous advisers asset class specifications for equity and derivatives are inappropriate given that, for purposes of asset allocation, asset classes should be: A. diversifying. B....
Study smarter with the SolutionInn App