c++ programme(look at images) An organization would like to store in an array up to 100 donations. A donation is a floating-point value. Write a program which reads donations and stores them into an array which is capable of only holding 100 floats. A value of -1 can be used to terminate the input. A sample run would be: Enter donation: 50.00 Enter donation: 20.00 Enter donation: 95.00 Enter donation: -1 As a result the array of donations would look like: Given this, using an additional array of 100 float pointers, sort the contents of the donations arrays without actually moving any data in the donations array. To do this, each element of the array of pointers should be pointing to the corresponding element of the donations array. Once this has been done, simply reorder the pointers to point to the elements of the donations array in ascending order. Your pointers array should look like this: Print out the collection of numbers sorted using the pointers array
c++ programme(look at images)
An organization would like to store in an array up to 100 donations. A donation is a floating-point value. Write a program which reads donations and stores them into an array which is capable of only holding 100 floats. A value of -1 can be used to terminate the input. A sample run would be:
Enter donation: 50.00
Enter donation: 20.00
Enter donation: 95.00
Enter donation: -1
As a result the array of donations would look like:
Given this, using an additional array of 100 float pointers, sort the contents of the donations arrays without actually moving any data in the donations array.
To do this, each element of the array of pointers should be pointing to the corresponding element of the donations array.
Once this has been done, simply reorder the pointers to point to the elements of the donations array in ascending order. Your pointers array should look like this:
Print out the collection of numbers sorted using the pointers array
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images