HELP!!!

You are writing a program to calculate the area for 500 different measurements for a playground company in the region. The company must calculate square footage of each prospective playground, as well as the total cost to mulch each area. The cost of mulch changes frequently, so the company would like to be able to input the current cost per square foot of mulch each time they run the program. Since the quantity of data is large, the input should come from a file called “measurements.txt”. You can assume the file includes the length of each prospective playground, followed by the width. The file will be in the following format.

450 300
120 210
.
.
.

Ask the user the name of the file they would like to write to, as well as the current price of mulch per square foot. Output the area of each playground, along with the total price of mulch to the file that the user specifies. The playground company would like each column of output to be 20 characters in width. Each column should have an appropriate heading in the output file. You should format your output data appropriately. For example, for the input data displayed above, along with a $2.00 per square foot mulch price, the output would be:

Area Total Mulch Price
135000 $270000.00
25200 $50400.00


I got this assignment and I am very confused I need help!!
What don't you understand how to do? Try looking at some tutorials if you don't really know how to program (for example, the ones on this site). Once you have something, if you are still having problems, feel free to ask about something specific then.
I don't understand how to read in the area and howmany numbers i should read in
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main()
{
char iFile[50];
char oFile[50];
float price, cost;
int a, b, area;

cout << "Please enter the output file name:" << endl;
cin >> oFile;
cout << "What's the current price of mulch per square foot?" << endl;
cin >> price;

ifstream infile("measurements.txt");
string out(oFile);
ofstream outfile(out);

outfile << "Area Total Mulch Price" << endl;
while (infile >> a >> b)
{
area = a * b;
cost = area * price;

string areaString = to_string(area);
string costString = to_string(cost);

int numSpaces = 20 - areaString.length() - costString.length() - 1;
string blanks(numSpaces, ' ');
outfile << areaString << blanks << "$" << costString << endl;
}

system("pause");
}
Why does this not work.
Topic archived. No new replies allowed.