Computers and Technology

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 17:00, heyitstierney5610
How can data be added in a table by using what view
Answers: 1
image
Computers and Technology, 21.06.2019 17:10, chiah
Type the correct answer in the box. spell all words correctly. which technology should andrea use? andrea owns a potato chips manufacturing unit. she has been getting complaints about the quality of the chips. she knows her product is good. she realizes that she needs to change the way the chips are packaged. she should use technology, which uses gases, such as carbon dioxide or argon, to create an air cushion, which improves the shelf life of products.
Answers: 2
image
Computers and Technology, 22.06.2019 03:10, brylove603
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
image
Computers and Technology, 22.06.2019 22:00, lgary9462
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass. cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array. c . run this program and observe the results.
Answers: 1
Do you know the correct answer?
Write a program which prompts the user to enter up to 20 floating point numbers (terminated with a n...

Questions in other subjects:

Konu
Mathematics, 22.04.2020 01:34
Konu
English, 22.04.2020 01:34
Konu
Mathematics, 22.04.2020 01:34