Answered step by step
Verified Expert Solution
Question
1 Approved Answer
WRITE CODE IN C++ LANGUAGE AND PLEASE DON'T USE A BREAK STATEMENT. ALSO SHOW MAIN Introduction to Computer Science I Lab # 7-Array storage, sorting,
WRITE CODE IN C++ LANGUAGE AND PLEASE DON'T USE A BREAK STATEMENT. ALSO SHOW MAIN
Introduction to Computer Science I Lab # 7-Array storage, sorting, handling partially filled arrays, and multi-file programs 1. 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 2. The maximum number of amounts in the file is 20, but it could have less. The progranm 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.50 7.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 29.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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started