All pastes #896082 Raw Edit

Something

public text v1 · immutable
·published 2008-02-08 09:57 UTC
rendered paste body
#include <iostream>
#include <fstream>
#include <string>
#include <climits>
#include <cmath>
using namespace std;

int main() {

	ifstream In;
	ofstream Out;
	In.open("expgrowin.txt");
	Out.open("expgrowout.txt");

	if (In.fail()) {
		cout << "Input file not found: " << In << endl;
		cout << "Existing..." << endl;
		return EXIT_FAILURE;
	}

	double Reserve, Rate;
	double AGR, resOut, resHalf;

	In.ignore(INT_MAX, '/n');

	In >> Reserve >> Rate;
	In.ignore(INT_MAX, '/n');
	while ( In ) {
		In >> AGR;
		In.ignore(256, '/n');
		resOut = 1/AGR * log((AGR * Reserve)/Rate + 1);
		resHalf = 1/AGR * log((AGR * Reserve)/(2 * Rate) + 1);
	}
	In.clear();

	Out  << "Programmer:  Kyle Kim" << endl
		 << "Exponential Growth and Decay" << endl << endl
		 << "	Initial Data" << endl << "Reserve:	" << Reserve << endl
		 << "Rate:		" << Rate << endl;
	In.close();
	Out.close();
	return 0;
}