Questions & AnswersC++ Programming

The main program will implement a seller management system with the...

Question
Answered step-by-step
Asked by egypthabib83 on coursehero.com

The main program will implement a seller management system with the...

The main program will implement a seller management system with the following pseudocode
design:


1. Initialization Step: Build the database of all the sellers.


//Perform seller management:


2. while (not done)
Display menu
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
 end while;


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
list
• 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
(5) quit.


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. 

Answer & Explanation

Solved by verified expert
Answered by AmbassadorOtterMaster691 on coursehero.com
<p><br/>sectetur adipiscing<br/>sectetur adipiscin<br/>sectetur adipisci<br/>sectetur adipis<br/>sectetur adipiscin<br/>sectetur adipiscing</p><p>sectetur adipi<br/>sectetur a<br/>sectetur adipiscing elit<br/>sectetur adipiscing el<br/>sectetu<br/>sectetur adipiscing elit. Nam lacinia pul<br/>sectetur adipiscing elit. Nam<br/>s</p>
CliffsNotes Logo

Unlock access to this and over
10,000 step-by-step explanations

Unlock Explanation

Have an account? Log In

Step-by-step explanation

<ul><li>sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus a</li></ul><p style="margin-left:40px;">sectetur adipiscing elit. Nam lacin<br/>sectetur adipiscing elit. Nam lacinia pulvi<br/>sectetur adipiscing elit. N<br/>sectetur adipiscing elit. Nam la<br/>sectetu</p><ul><li>sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel l</li><li>sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequa</li><li>sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, cong</li><li>sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit a</li><li>sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequa</li><li>sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel lao</li><li>sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitu</li></ul>

Get unstuck with a CliffsNotes subscription

Example CliffsNotes Question and Answer
Unlock every step-by-step explanation, download literature note PDFs, plus more.Get Access

Related Q&A