Record Detail

Compile Error

/in/ex4.cpp: In member function 'virtual void bookInventory::printInventory() const':
/in/ex4.cpp:59:9: error: 'cout' was not declared in this scope
         cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << "\n" << "Available: " << (books[i].isAvailable ? "Yes" : "No") << endl;
         ^~~~
/in/ex4.cpp:59:187: error: 'endl' was not declared in this scope
         cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << "\n" << "Available: " << (books[i].isAvailable ? "Yes" : "No") << endl;
                                                                                                                                                                                           ^~~~
/in/ex4.cpp:59:187: note: suggested alternative: 'enum'
         cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << "\n" << "Available: " << (books[i].isAvailable ? "Yes" : "No") << endl;
                                                                                                                                                                                           ^~~~
                                                                                                                                                                                           enum
/in/ex4.cpp: In member function 'void library::listBorrowed() const':
/in/ex4.cpp:89:13: error: 'cout' was not declared in this scope
             cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << endl;
             ^~~~
/in/ex4.cpp:89:125: error: 'endl' was not declared in this scope
             cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << endl;
                                                                                                                             ^~~~
/in/ex4.cpp:89:125: note: suggested alternative: 'enum'
             cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << endl;
                                                                                                                             ^~~~
                                                                                                                             enum
/in/compile/Makefile:26: recipe for target 'ex4.o' failed
make: *** [ex4.o] Error 1

Information

Submit By
Type
Submission
Homework
Exercise 4
Language
C++
Submit At
2024-11-20 16:25:38
Judged At
2024-11-20 16:25:38
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes