Write a program that will create an array of 5 integers and fill the array with...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that will create an array of 5 integers and fill the array with values given by the user. The program should display all the numbers entered by the user and test if all the numbers are odd or all the numbers are even or if the numbers are a mix of even and odd values. Sample run 1: Enter 10 integers: 6 10 12 4 2 The enter numbers from last to the first is 2 4 12 10 6 All the numbers are even Sample run 2: Enter 10 integers: 3 7 9 13 15 The enter numbers from last to the first is 15 13 9 7 3 All the numbers are odd Sample run 2: Enter 10 integers: 3 6 8 12 15 The enter numbers from last to the first is 15 12 8 6 3 The numbers are a mix of odd and even values Write a program that will create an array of 5 integers and fill the array with values given by the user. The program should display all the numbers entered by the user and test if all the numbers are odd or all the numbers are even or if the numbers are a mix of even and odd values. Sample run 1: Enter 10 integers: 6 10 12 4 2 The enter numbers from last to the first is 2 4 12 10 6 All the numbers are even Sample run 2: Enter 10 integers: 3 7 9 13 15 The enter numbers from last to the first is 15 13 9 7 3 All the numbers are odd Sample run 2: Enter 10 integers: 3 6 8 12 15 The enter numbers from last to the first is 15 12 8 6 3 The numbers are a mix of odd and even values
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class ArrayInputExample1 public static ... View the full answer
Related Book For
Artificial Intelligence A Modern Approach
ISBN: 978-0137903955
2nd Edition
Authors: Stuart J. Russell and Peter Norvig
Posted Date:
Students also viewed these programming questions
-
Write a program that simulates stable storage. Use two large fixed-length files on your disk to simulate the two disks.
-
Write a program that will compute statistics for eight coin tosses. The user will enter either an h for heads or a t for tails for the eight tosses. The program will then display the total number and...
-
Write a program that will take as input two Web page URLs and find a path of links from one to the other. What is an appropriate search strategy is bidirectional search a good idea? Could a search...
-
Q1- An engineering student is trying to create a new drivetrain system for his bike, consisting of a pully system. Pully A is connected to pully B by a non-slip belt and pully B is rigidly attached...
-
Refer to Exercise 12.6. The researcher has decided that a more meaningful evaluation of the new program would use the difference between the score on the exam at the end of the fifth grade and that...
-
Why might a newly formed organization be considered successful even if it is losing money?
-
On August 6, it was 80o F in New York City, so it was twice as hot as on December 7, when it was 40 F. Determine whether the given statement represents a meaningful ratio, so that the ratio level of...
-
Razor Sharp Company purchased tool sharpening equipment on July 1, 2008, for $48,600. The equipment was expected to have a useful life of three years, and a residual value of $3,000. Instructions...
-
The Reigle Company had the following items on its December 31, 20X0, balance sheet and 20X0 income statement (in dollars except for number of shares outstanding): Cash and equivalents $ 60,000...
-
Lets return to the chapters discussion of Jack and Jills water duopoly. Suppose that Jack and Jill are at the duopolys Nash equilibrium (80 gallons) when a third person, John, discovers a water...
-
Q3.two masses m and m are connected by a string pulled on horizontal smooth plane by an external force F as in figure .let tension T=8N,m-2kg and m= 3kg. Find the force F M T M F=?
-
Should an organization change strategies when performance declines? Explain.
-
What types of alternatives can be generated from a SW/OT matrix?
-
How do a SWOT analysis and SW/OT matrix help managers in the strategic decision-making process?
-
What is the value chain? How is it useful to strategy formulation?
-
An increase in the breadth of an organizations structure is known as __________. A. centralization B. decentralization C. horizontal growth D. vertical growth
-
In the circuit shown, the capacitor C4 is unknown, and all the capacitors are initially discharged. The capacity of the equivalent capacitor between the two points A and B is: Ceq 12 F. = A C6 =18 F...
-
Write a paper by answer the following question: Should Recycling Be Mandatory?
-
Let us examine the rationality of various vacuum-cleaner agent functions. a. Show that the simple vacuum-cleaner agent function described in Figure is indeed rational tinder the assumptions listed....
-
The two preceding exercises assume a fairly primitive notion of ownership. For example, the buyer starts by owning the dollar bills. This picture begins to break down when, for example, ones money is...
-
Repeat Exercise 20.1, this time plotting the values of P (D m+1 = limeh MAP) and P (D m+1 = limehML).
-
Preventing a user who approves a configuration change from being the person who implements the change is an example of which of the following? A. Rotation of duties B. Least privilege C. Segregation...
-
A onedimensional heat conduction problem can be expressed by the following differential equation: where \(k\) is the thermal conductivity, \(T(x)\) is the temperature, and \(Q\) is heat generated per...
-
Consider a simply supported beam of length \(L\) subjected to a uniformly distributed transverse load \(p(x)=p_{0}\). Use the Rayleigh-Ritz method to determine the transverse deflection \(v(x)\) of...
Study smarter with the SolutionInn App