The main program will implement a seller management system with the following pseudocode
1. Initialization Step: Build the database of all the sellers.
//Perform seller management:
2. while (not done)
Get user choice
choice 1: Print information of all sellers
choice 2: Check information of a particular seller
choice 3: Add a seller to the list
choice 4: Remove a seller from the list
choice 5: quit
The initialization phase:
• initializes the boolean flag/variable done and read information of the sellers from a file
seller.dat and add them into a list of sellers. The file seller.dat will contain information
concerning sellers. The first line before every seller will contain a letter 'S' or 'P'
meaning that a seller is to be read or a power seller is to be read. If 'S' is read, then the
information will appear for a seller as described above.
• If 'P" is read, then the data starts with all information as a regular seller, and then
followed by the seller's own web site address (string) and the number of items sold in the
current year, one per line.
• All the sellers (whether a regular seller or a power seller) are to be added into the same
• A STL list should be used to store all the sellers.
In the loop that performs seller management:
At the beginning of each iteration of the loop, a menu is displayed to
(1) allow the user to print all sellers,
(2) check a seller's record,
(3) add a seller to the list of sellers,
(4) remove a seller from the list, or
Write a function to display the menu.
Write a separate function for each of the following four choice tasks:
(1) If the user selects the option to print all sellers, then all seller records should be printed. For
each seller in the list, all information of that seller is to be displayed, and for a power seller in
the list, all information of a power seller is to be displayed. Use dynamic binding to let the
system determine whether the seller is just a seller or a power seller. After all the information
is displayed, the control should be returned to the seller management menu.
(1) If the user selects the option to check a seller's record, then the user should be prompted for
the seller's name. If the seller is found, then all information pertaining to the seller should be
displayed. If the seller is not found, then an error message should be displayed. Use dynamic
binding to let the system determine whether the seller is just a seller or a power seller.
(2) If the user selects the option to add a seller, then the user should be asked whether the seller is
a power seller or not. If not, then just read a seller's information and add it to the list of
sellers. Otherwise, read a power seller's information and add it to the list of sellers.
(3) If the user selects the option to delete a seller, then the user should be asked to enter the
firstname and lastname of the seller (or power seller) to be removed. If the seller is found,
he/she is removed from the list, otherwise, display an error message.
Unlock access to this and over
10,000 step-by-step explanations
Have an account? Log In