Wyo Data Structures Ch. 4 Programming Assignment
Ch4Proj3.cpp
Modify Ch4Proj2 with the following additional specifications.
The unread messages must be saved to a sequential access text file
Z:\Data Structures\Ch 4\unread.txt.
The format of this file must be:
3
Hi Mom
Hi Bob
Hi Jane
or
3Hi Mom
Hi Bob
Hi Jane
(if observed using NotePad or even Visual Studio) where the first record (usually
line) of the sequential file is the number of messages stored there. Each of
the individual messages must be stored on a separate line of the file though.
Also, when the program executes, it must first read any messages from this file
into the unread message queue before allowing the user to send, read, or delete
messages.
You must also use the following functions(s)
(besides the main function) to demonstrate modular, structured programming.
bool readMessages(ifstream unreadMessageFile, apqueue <apstring> &
unreadQ)
// precondition: the first record of the file will contain the number of messages
stored there if nonempty
// postcondition: true is returned if the file was opened successfully, false
is returned otherwise
bool storeMessages(ofstream storeMessageFile, apqueue <apstring>
& unreadQ)
// precondition: none
// postcondition: true is returned if the file was opened successfully, false
is returned otherwise, all items of unreadQ are
// written to separate lines of the file, the number of messages will be stored
as the first record of the sequential file
Your program must follow the Coding Standards. Save the source code file as "Ch4Proj3.cpp" in the appropriate network folder.
Preconditions: