Answered step by step
Verified Expert Solution
Link Copied!

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,

image text in transcribedimage text in transcribedWRITE 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

1 . Television News channels importantance of our Life pattern ?

Answered: 1 week ago

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago