Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Three salesmen work for a pharmaceutical company. Each salesman has an ID. salary and phone number as shown in the example below. ID 11

image text in transcribed

image text in transcribed

c++

Three salesmen work for a pharmaceutical company. Each salesman has an ID. salary and phone number as shown in the example below. ID 11 12 13 salary $1000 $1200 $1300 phone number 2388888 2377777 2355555 Declare the arrays necessary to enter the information of 20 salesmen, and initialize them with the information of the three salesmen above (i.e. the first three cells of each array are initialized as shown in the table above). Then, the program must display the following list of tasks 1. Add a salesman 2. Delete a salesman 3. Search for a salesman by his ID 4. Exit The user chooses a task by entering the task number ( 1, 2, 3 or 4). Write the 3 functions necessary to perform the previous tasks (add, delete and search), then call these functions to perform the tasks chosen by the user. The program must keep on displaying the previous list of tasks and performing the required tusk until the user enters 4. (Hint: the main loop is ended when 4 is entered). If the number of salesmen entered by the user exceeds 20 (which is bigger than array size), the program must display the following message on screen: Sorry, the company has enough salesmen at the current time, if you want to add a new salesman, you should delete one first. Notes and hints: - All the steps from 1 to 3 must be done using functions. Use the concept of parallel arrays. . When you delete a salesman, you have to shift the information of the following ones in each of the arrays. - When you add a salesman, add his information at the end of the arrays (if the number of salesmen is under 20). Three salesmen work for a pharmaceutical company. Each salesman has an ID. salary and phone number as shown in the example below. ID salary phone number 11 $1000 2388888 12 $1200 2377777 13 $1300 2355555 Declare the arrays necessary to enter the information of 20 salesmen, and initialize them with the information of the three salesmen above (1.e. the first three cells of each array are initialized as shown in the table above). Then, the program must display the following list of tasks 1. Add a salesman 2. Delete a salesman 3. Search for a salesman by his ID 4. Exit The user chooses a task by entering the task number (1, 2, 3 or 4). Write the 3 functions necessary to perform the previous tasks (add, delete and search), then call these functions to perform the tasks chosen by the user. The program must keep on displaying the previous list of tasks and performing the required task until the user enters 4. (Hint: the main loop is ended when 4 is entered). If the number of salesmen entered by the user exceeds 20 (which is bigger than array size), the program must display the following message on screen: Sorry, the company has enough salesmen at the current time, if you want to add a new salesman, you should delete one first. Notes and hints: - All the steps from 1 to 3 must be done using functions. - Use the concept of parallel arrays. - When you delete a salesman, you have to shift the information of the following ones in each of the arrays. - When you add a salesman, add his information at the end of the arrays (if the number of salesmen is under 20)

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago