subject

Write a program which prompts the user to enter up to 20 floating point numbers (terminated with a non-numeric), reads them into an array, then prints the following. To make it easier for you, your input is guaranteed to have at least one negative number. Make sure to test with a wide range of values. You must use an array (not a vector) to get credit. The array values in the original order, separated by a space.
The array values where every other element is reversed starting with the first one, separated by a space (see example).
Negative values, separated by a space in the same order as the original array (zero is neither positive nor negative).
The smallest number in the array.
The average of all the negative values in the array.
Example program output with user input shown in bold:

Enter a list of up to 20 integers, and a non-numeric to quit:
-8.9 1.2 -1.1 2.3 3.4 4.5 5.6 6.7 7.8 8.9 -5.0 q

The original array is: -8.9 1.2 -1.1 2.3 3.4 4.5 5.6 6.7 7.8 8.9 -5
The reversed array: -5 1.2 7.8 2.3 5.6 4.5 3.4 6.7 -1.1 8.9 -8.9
Negative values: -8.9 -1.1 -5
Smallest number: -8.9
Average of all the negative values: -5

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:50
Which are steps taken to diagnose a computer problem? a) reproducing the problem and using error codes b) reproducing the problem and troubleshooting c) using error codes and troubleshooting d) using error codes and stepping functions
Answers: 1
question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 22.06.2019 18:00
Budgets you to do all of the following expect a) send frivolously b) avoid over spending c) gain financial independence d) examine your priorities and goals
Answers: 2
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
You know the right answer?
Write a program which prompts the user to enter up to 20 floating point numbers (terminated with a n...
Questions
question
Mathematics, 09.03.2021 04:40
question
Mathematics, 09.03.2021 04:40
question
Mathematics, 09.03.2021 04:40
question
Mathematics, 09.03.2021 04:40
Questions on the website: 13722367