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.
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;