I am having trouble taking a # from inData.txt and outputting the value into outData.txt
The values that are in my inData.txt are:
10.20 5.35
The values that appear in my outData.txt are:
Rectangle:
Length= -92559631349317830000000000000000000000000000000000000000000000.00, Width= -92559631349317830000000000000000000000000000000000000000000000.00, Area= 8567285355521621000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.00, Perimeter= -370238525397271320000000000000000000000000000000000000000000000.00
Here is my code(Right now I am just working on outputting the length, width, area, and perimeter )
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
int main ()
{
// Filestream Variable declaration
ifstream inFile;
ofstream outFile;
// Variable Declaration
double length, width, areaOfRectangle, perimeter, radius, areaOfCircle, beginningBalance, interestRate, pi,
circumference, endingBalance;
string firstName, lastName;
int age;
char ch;
// Opening Filestream Variables
inFile.open("inData.txt");
outFile.open("outData.txt");
// Data Manipulation
outFile << fixed << showpoint;
outFile << setprecision(2);
cout << "Processing Data..." << endl;
// Variable Association
inFile >> length >> width;
outFile <<"Rectangle:" << endl;
areaOfRectangle = length * width;
perimeter = (length * 2) + (width * 2);
outFile <<"Length= " << length << ", Width= " << width << ", Area= " << areaOfRectangle << ", Perimeter= " << perimeter << endl;
// Closing Filestream Variables
inFile.close();
outFile.close();
return 0;
}
This will check your code: