Question: Write a C++ program that uses looping structures and arrays to (1) Display your ID line on the console AND write it to the output
Write a C++ program that uses looping structures and arrays to (1) Display your ID line on the console AND write it to the output file. (2) Read and display the contents of an input file containing ten (10) one- and two-digit numbers. Create your own input file with the name Lab24.dat (as demonstrated in class). (3) Test for File Open errors. Exit the program with the message Error opening input file if an input file open error occurs. The program must terminate if a file open error occurs. (4) Use a function to sort the array using the bubble sort technique demonstrated in class. (5) Display the sorted array AND write the contents of the sorted array to an output file named (Lab24.out). (6) Use the same cout messages used in the sample below. (7) Formatting line up the ones column in each set of output figures (as shown below).
do NOT create the input file as part of your program. Your program will be tested using a separate input file. *IMPORTANT: Be sure to output an identifier line in your program to be displayed on the console AND written to the output file, include appropriate comments in your program, chose meaningful identifiers, and use indentation as the programs do in your textbook.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
