Question: Array storage, sorting, and handling partially filled arrays in C++ 1. Create a program in C++ that reads in a series of sales dollar amounts
Array storage, sorting, and handling partially filled arrays in C++
1. Create a program in C++ that reads in a series of sales dollar amounts from a file, stores the amounts in an array, processes the array, and outputs to a file and the console the number of sales amounts, the lowest amount, the highest amount, and a complete list of the amounts in order from lowest to highest. Sample output shown on the next page.
2. The maximum number of amounts in the file is 20, but it could have less. The program must keep track of the number of amounts read in from the file, and stop at the sentinel.
3. Required functions:
(1) opening the files and file failure conditions,
(2) reading the input and storing the values,
(3) sorting the array,
(4) writing and displaying the output.
4. Create an input file named salesAmounts.txt with the following values in the order that they appear below vertically in the file. Zero marks the end of the data set and is not one of the amounts. The file location must be the project folder.
29.95 3.55 34.70 12.34 2.67 33.89 24.99 18.45 4.99 9.95 0.00 5.
Recommendation: Use bubble sort in your solution (code provided)

Comments: The list of what the program is to do is not in a specified order.

Bubble sort for an array of integers is shown below. void bubblesort(int arr], int length) // Bubble largest number toward the right for (int i =length-1; i : i-) for Cint j 0; j
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
