#include #include #include using namespace std; const int MAX = 10; struct Pen { string color; string brand; int inkRemaining; int length; }; int main () { Pen pens[MAX]; ifstream inFile; inFile.open("data.txt"); if (!inFile) { cout << "ERROR - Input file did not open."; return 1; } for (int i = 0; int < MAX; int++) { inFile << pens[i].color; inFile << pens[i].brand; inFile << pens[i].inkRemaining; inFile << pens[i].length; } for (int i = 0; int < MAX; int++) { cout << "Pen " << i + 1 << ":" << endl; cout << "-------------------------------" << endl; cout << "Color: " << pens[i].color << endl; cout << "Brand: " << pens[i].brand << endl; cout << "Ink Remaining: " << pens[i].inkRemaining << "%" << endl; cout << "Type Of Pen: " << pens[i].typeOfPen << endl; return 0; }