Write a C++ program that prompts the user to enter the size of a one-dimensional array...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ program that prompts the user to enter the size of a one-dimensional array of type integer, the program then does the following: Reads positive integers in the array Prints the array Calculates and prints the average of the array Prints numbers greater and less than or equal to the average Prints the greatest and the smallest numbers Prints even numbers Prints odd numbers Sample Input/Output: Enter the size of the Array. 10 Enter integer values for an Array of size 10 10 19 15 25 30 23 12 6 44 17 Array: 10 19 15 25 30 23 12 6 44 17 Average of the Array is 20.1 6 numbers are less or equal to 20.1 and 4 numbers are greater than 20.1 Greatest number is 44 and Smallest number is 6 Even numbers: 10 30 12 6 44 Odd numbers: 19 15 25 23 17 Write a C++ program that prompts the user to enter the size of a one-dimensional array of type integer, the program then does the following: Reads positive integers in the array Prints the array Calculates and prints the average of the array Prints numbers greater and less than or equal to the average Prints the greatest and the smallest numbers Prints even numbers Prints odd numbers Sample Input/Output: Enter the size of the Array. 10 Enter integer values for an Array of size 10 10 19 15 25 30 23 12 6 44 17 Array: 10 19 15 25 30 23 12 6 44 17 Average of the Array is 20.1 6 numbers are less or equal to 20.1 and 4 numbers are greater than 20.1 Greatest number is 44 and Smallest number is 6 Even numbers: 10 30 12 6 44 Odd numbers: 19 15 25 23 17
Expert Answer:
Answer rating: 100% (QA)
Answer Heres a C program that implements the described functionality include include int main int si... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
SUBJECT 3 (2.5 UNITS)The company "APOLLON" has calculated that for the production of oneunitof finished product requires standards of 8 kg of direct materials(AU) and thestandard price was set at 2...
-
What is the extent of a business's ethical obligation to protect the personal information of its customers and employees? Discuss.
-
Use the information contained in problem 2 to answer this problem. Suppose that monetary policymakers do not want to see a permanent rise in the inflation rate result from the increase in government...
-
Defendants Jack and Claire Lein owned and lived on Willow Creek Farm from 1980 through 2004. The farm manager, Stewart, and his girlfriend, plaintiff Tambra Curtis, also lived on the farm during this...
-
The following selected accounts appear in the ledger of Patton Environmental Inc. on July 1, 2012, the beginning of the current fiscal year: Preferred 2% Stock, $75 par (40,000 shares authorized,...
-
SQL is a pervasive querying language. While there is one primary SQL dialect that all SQL RDBMS implementations must support, and that's ANSI SQL, each database platform comes out with its own...
-
You manage Walnut Customer Call Center, a small business that provides call- center services under contract with various firms. Your staff of 12 employees has enjoyed a dress code that is very...
-
3. Dr. Teismann is traveling to Halifax at 110 km/hr when he sees a deer crossing the road 50 metres ahead. After slamming on the brakes, what is the minimum constant deceleration Dr. Teismann must...
-
In what ways do the wide discretionary powers possessed by actors in the justice system contribute to the concept of system fragmentation discussed in Chapter One?
-
Elements of a Contract Describe and analyze the five elements of a contract that must exist for this agreement to be enforceable?
-
Search into the US airline industry to see whether it lacks competition as claimed in the article. Would you agree the thin profit margin in the airline industry (in the US) is due to lack of...
-
For the function f(x) x = -1. Answer: = = x + 12, find the equation of the tangent line at Submit Answer
-
What is the end balance for the following check register? Check Register Check No. 1230 1231 9/2 Utilities 9/4 Target 9/5 9/7 O $1,899.25. O $2,599.25. $2,700.25. O $1.201.25. Paycheck Cash (ATM)...
-
Find the reduced echelon form of each of the matrices given in Problems 120. c 1 26 + 4
-
Which of the following can be specified by using a parameter in one or more versions of the JTextField constructor? a. The initial text in the field b. Requiring that the value entered be nonnumeric...
-
Recall how to obtain a random number. For example, the following statement generates a random number between the constants MIN and MAX inclusive and assigns it to a variable named random: random =...
-
The catch block that begins catch(Exception e) can catch Exceptions _________________. a. Of type IOException b. Of type ArithmeticException c. For both IOExceptions and ArithmeticExceptions d. For...
-
Let \(\left\{\mathbf{X}_{n}ight\}_{n=1}^{\infty}\) be a sequence of \(d\)-dimensional random vectors that converge in distribution to a random vector \(\mathbf{X}\) as \(n ightarrow \infty\). Let...
-
Let \(\mathbf{X}\) be a \(d\)-dimensional random vector with distribution function \(F\). Let \(g: \mathbb{R}^{d} ightarrow \mathbb{R}\) be a continuous function such that \(|g(\mathbf{x})| \leq b\)...
-
In the context of the proof of Theorem 4.3, prove that \[\lim _{n ightarrow \infty}\left|\int_{a}^{b} g_{m}(x) d F(x)-\int_{a}^{b} g(x) d F(x)ight| for any \(\delta_{\varepsilon}>0\). Theorem 4.3...
Study smarter with the SolutionInn App