The area and perimeter

The following program is supposed to read the length and width of a rectangle from a file named input.txt and write the area and perimeter of the numbers to a file named output.txt. However, it fails to do so. Rewrite the program so that it accomplishes what it is intended to do. (Also, include statements to close the files.) (10)

include

using namespace std;

int main()

double length, width;

ofstream outfile;

infile.open(“input.txt”);

infile >> length >> width;

outfile

return 0;

“area=”

<< ” ,=”” perimeter=””>

return 0;

}

>

WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X