Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Client program: Once you have created the BookList class, create a client program ( main ) called lab 2 . cpp . In your client

Client program:
Once you have created the BookList class, create a client program (main) called lab2.cpp. In your client program,
Create a BookList object.
Open and read from the "books.txt" file (only once!) and populate the book list with all the book information read from file. The user must specify the file path for the data file; however, for testing, you can download the project files here: p1 files.zip (you will only be using "books.txt" for this lab!)
From P1: Recommendations:
In order to grab each line (i.e. string) from a file, delimited by comma, you can use getline():
string filename = "sometextfile.tx string str; ifstream infile; infile. open (filename); while(getline(infile, str,',')){} cout str endl;
If a delimiter is not included (2 parameters), get l ine will continue reading until it reaches a '??
' character (by default). By including the third parameter, the get l ine function will stop reading further input after
4 Previous
Next
Dashboard
Calendar
3
To Do
Notifications
Inbox
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions