Question: Lab # 7-Array storage, sorting, handling partially filled arrays, and multi-file programs Create a multi-file program that reads in a series of sales dollar amounts

 Lab # 7-Array storage, sorting, handling partially filled arrays, and multi-fileprograms Create a multi-file program that reads in a series of sales

Lab # 7-Array storage, sorting, handling partially filled arrays, and multi-file programs Create a multi-file program that reads in a series of sales dollar amounts from a file (salesAmounts.txt), stores the amounts in an array, processes the array, and outputs to a file and the console window the number of sales amounts, the lowest amount, the highest amount, and a complete list of the amounts in order from lowest to highest, and the total of the amounts. Sample output shown on the next page 1. 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 and stop at the end of the file 3. Required functions called from main: (1) opening the files with file failure conditions, (2) reading the input and storing the values, (3) sorting the array, (4) summing the amounts, (5) displaying the data and writing to a file named yourName.txt Create an input file named "salesAmounts.txt" with the following values in the order that they appear below, but vertically in the file. Read until the end-of-file 29.95 3.55 34.70 12.34 2.67 33.89 24.99 18.45 4.99 16.507.57 20.38 9.95 4. 5. Main can only have the variable and array declarations, function calls, and file closing 6. All functions are to be in a header (second) file. salesAmounts.txt-Notepad File Edit Format View Help 9.95 3.55 34.70 12.34 2.67 33.89 24.99 18.45 4.99 16.50 7.57 20.38 9.95 Submit a text file with all of the code via RCBC email. Lab references File I/O Keeping track of partially filled array - page 408 Array Sort pages 282-286 page 476-486 Lab comments: The list of what the program is to do is not in a specified order. The engineer (you) decide the algorithm, and what should be done first, second, etc. (A flow chart might help you decide) Recommendation: Use bubble sort in your solution (code provided on next page)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!