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
-
0 . 2 8 x - 0 . 1 2 x = 0 . 0 8 ( 0 . 4 8 - x )
-
A coordinator will select 8 songs from a list of 9 songs to compose an event's musical entertainment lineup. How many different lineups are possible? Answer How to enter your answer (opens in new...
-
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.
-
1. Explain how pressures and incentives drove the actions taken by Hudgins and Kitay to commit financial statement fraud. 2. Describe the problems in the audit of Weatherford International by Ernst &...
-
The Barings desk on the trading floor is abandoned. The computer screens are dead. The little Union Jack that was sitting on one of the terminals a few days ago has mysteriously vanished. This little...
-
Balance sheets for Salt Company and Pepper Company on December 31, 2010, follow: Pepper Company tentatively plans to issue 30,000 shares of its $20 par value stock, which has a current market value...
-
Monty Company uses the gross profit method to estimate inventory for monthly reporting purposes. Presented below is information for the month of May. Inventory, May 1 $165,300 Purchases (gross)...
-
A company conducts a consumer survey with questions about home ownership (OwnHome: Yes/No), car ownership (OwnCar: Yes/No), annual household spending on food (Food), and annual household spending on...
-
a. Equipment with a book value of $65,300 and an original cost of $133,000 was sold at a loss of $14,000. b. Paid $89,000 cash for a new truck. c. Sold land costing $154,000 for $198,000 cash,...
-
For your organization and incident investigations, how can you use Dr. Reason's Swiss Cheese model in the development of your company's or your future company's incident investigation program? Is...
-
A professor is a member of a professional organization and is mostly interested in the newsletters sent and in participating in conferences. What benefit is the professor primarily seeking?Explain
-
When I invested $50,000 in this mutual funds at the beginning of the 3rd year, how much the invested money would be worth at the end of the year 8??State each step of calculation and explain the...
-
How can an organization ensure that they are asking the right questions during the market research process?
-
Describe what actions an organization can take to encourage employees to think more creatively. Describe the characteristics of an effective control system.
-
Discuss how you might interpret an upward sloping yield curve. Flat yield curve. Downward sloping yield curve. (EACH THEORY) Find the current yield curve for U.S. Treasuries or any other country and...
-
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...
-
The systematic risk principle has an important implication, which is that a. b. C. d. systematic risk is preferred to unsystematic risk systematic risk is the only risk that can be reduced by...
-
A financial market's security market line (SML) describes a. b. PSJP C. d. the relationship between systematic risk and expected returns the relationship between unsystematic risk and expected...
-
The systematic risk of a stock is measured by its a. b. C. d. beta coefficient correlation coefficient retum standard deviation retum variance
Study smarter with the SolutionInn App