Computers and Technology

String nameOfFile is read from input. The opened file named nameOfFile contains counts of racks ordered by a furniture store, and is associated with the stream rackFS. Integers are read from the opened file and output, before being subtracted from remainingQuantity. Output "Unsold: " followed by remainingQuantity if the end of the file has been reached. Otherwise, output "Read operation failed" if a read operation fails before the end of the file is reached. End with a newline.Ex: If the input is data3.txt, then the output is:8861Unsold: 53Ex: If the input is data5.txt, then the output is:971129Read operation failedContents of file data1.txtContents of file data2.txtContents of file data3.txtContents of file data4.txtContents of file data5.txtContents of file data6.txt6972bad59263936886156bad971129bad68bad386562Integers are read from the file named nameOfFile using a while loop. The while loop terminates when rackFS.fail() returns true, indicating an error for the previous read operation or that the end of the file has been reached.!rackFS.eof() returns true if the end of the file has not been reached in the previous operation.If rackFS.eof() returns true after the while loop terminates, the program outputs "Unsold:" followed by remainingQuantity.If !rackFS.eof() returns true after the while loop terminates, then an error has occurred before the end of the file is reached and the error message is output.Not all tests passed.Current Script:#include #include #include using namespace std;int main() {ifstream rackFS;string nameOfFile;int rackQuantity;int remainingQuantity;cin >> nameOfFile;rackFS.open(nameOfFile);if (!rackFS.is_open()) {cout