C++ program Write a program using vectors and iterators that reads the titles of
ID: 3576241 • Letter: C
Question
C++ program
Write a program using vectors and iterators that reads the titles of books from a file and loads them into a vector
1. a function to load the vector
2. a function to prompt the user for a book title to display
-throw exception if appropriate
in main()
-define a vector
-call function to load the vector
-call function to prompt the user for which book to display
-enter the title: return what number it is in the list
-enter a number: return the title of the book
-handle exceptions
-display all the book title
Explanation / Answer
#include #include #include #include int main() { std::string line; vector DataArr; vector QueryArr; ifstream myfile("data.txt"); ifstream qfile("data1.txt"); if(!myfile) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.