Question: Write an C/C++ program that will reads a table from an ASCII file and produces statistical information in an ASCII output file. The program should

Write an C/C++ program that will reads a table from an ASCII file and produces statistical information in an ASCII output file. The program should read the information about some exoplanets from the file named "ExoTable.txt" Download "ExoTable.txt". This file contains one row for each exoplanet with the following information in order:

  1. Sequential number in the list (integer starting at 1)
  2. Exoplanet's name (a string with up-to 25 characters)
  3. Exoplanet's distance to earth in light years (float)
  4. Exoplanet's mass ratio with respect to earth (float|)
  5. Exoplanet's orbit in earth days (float)
  6. Exoplanet's year of discovery

The program should read the information in the file and determine the following information from the exoplanets to be printed in the file "SummaryExoTable.txt":

  1. Minimum, maximum, and average distance to the earth in light years
  2. Minimum, maximum, and average mass ratio with respect to the earth
  3. Minimum, maximum, and average orbit in earth days
  4. Minimum and maximum discovery years
  5. The name of the exoplanet that is closest to the earth
  6. The name of the exoplanet that is closest in mass to the earth
  7. The name of the exoplanet that is closest in orbit days to the earth
Write an C/C++ program that will reads a table from an ASCII

\f

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!