Question: Programming Language : C++ Write a program which reads the .csv file, data from .cvs file , data is below, creata a .cvs file using
Programming Language : C++
Write a program which reads the .csv file, data from .cvs file , data is below, creata a .cvs file using the data below
.csv file data
43154 MATH 114 Pre Algebra MW 08/13-12/16 12:00 PM-02:15 PM
74567 CHEM 128 Intro Chems MW 10/08-12/09 05:30 PM-07:45 PM
22412 ENG 001 College English M 08/13-12/16 06:00 PM-07:50 PM
Use the data to perform the following steps:
| a. | Open the file and read the data into a multi-dimensional array. The array should have two dimensions. The primary (first) dimension should contain one row (record) of data. The second dimension should contain one element (field) of data. All array items should be declared as string type. No consideration should be made for what information is represented by the data. | |
| b. | Open an output file named: out.txt A "flat file" is a text file that opens in a text editor. It contains no special or unreadable characters. A flat file is created using standard file i/o. | |
| c. | Write each data element from the multi-dimensional array to the output file. To make the columns of the output file fixed-width you will have to insert the number of spaces necessary to start each column at the correct position. The data order should match the input file, with the first row in the input file being the first row in the output file. | |
| d. | Close the input file before opening the output file. Remember to close the output file when you are done with it. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
