Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Program that reads from a file. This file has values that are scewed. There

ID: 644575 • Letter: C

Question

C++ Program that reads from a file. This file has values that are scewed. There are 22772 rows, and 21 columns. Each row is seperated by 21 blank spaces. This program should print to a new file called corrected. This program will keep the values current order but make it so they are all aligned. The values will be brought up to be right under the values that are above it. Here is an example of what the file looks like.


                   4178                                                          
3.3                                                                              
   104                                                                          
       6                                                                      
           37                                                                  
               3.5                                                              
                       19                                                      
                           112                                                  
                               2.49                                              
                                   158                                          
                                       28                                      
                                           9.4                                  
                                               1.5                              
                                                                              
                                                       4.7                      
                                                           17.7                  
                                                               4.5              
                                                                   2.88          
                                                                       146      
                                                                           55  
                                                                               4.6
                   3309       

these values should all be in there same order, brought up in their respective column to be organized.

Explanation / Answer

#include

#include

using namespace std;

int main()

{

       

    ifstream fin;

    fin.open("old.txt",ios::in);

    ofstream fout;

    fout.open("new.txt",ios::out);

    char ch,str=

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote