Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
- Sequential number in the list (integer starting at 1)
- Exoplanet's name (a string with up-to 25 characters)
- Exoplanet's distance to earth in light years (float)
- Exoplanet's mass ratio with respect to earth (float|)
- Exoplanet's orbit in earth days (float)
- 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":
- Minimum, maximum, and average distance to the earth in light years
- Minimum, maximum, and average mass ratio with respect to the earth
- Minimum, maximum, and average orbit in earth days
- Minimum and maximum discovery years
- The name of the exoplanet that is closest to the earth
- The name of the exoplanet that is closest in mass to the earth
- The name of the exoplanet that is closest in orbit days to the earth
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started