#include #include // For setprecision() using namespace std; int main( ) { ifstream rainbow; // input file stream ofstream heights; // output file stream double distance, // Distance of rainbow heightMain, // 1st Rainbow's height heightSecondary, // Shadow's height numInput = 5; // Number of data inputs rainbow.open("rainbow.dat"); heights.open("heights.dat"); heights.setf(ios::fixed, ios::floatfield); heights.setf(ios::showpoint); heights << "Larry Titus" << endl; //*** substitute your own name *** heights << "Rainbow Heights (in miles)" << endl << endl; rainbow.ignore(200, '\n'); // Skip to next line of input. heights << " Rainbow Secondary Distance" << endl; heights << "---------------------------------------------" << endl; if (rainbow) && (numInput > 0) rainbow >> distance; while ( (rainbow) && (calculated < numInput) ) { calculated++; rainbow.ignore(200, '\n'); // Skip to next line of input.