Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program) Design a class for a sales person that has the following members variable: --EID: To holds the sales persons employment ID --Firstname: To

C++ program)

Design a class for a sales person that has the following members variable:

--EID: To holds the sales persons employment ID

--Firstname: To holds the sales persons first name.

--Lastname: To holds the sales persons last name.

--Date: To holds the sales persons birth date

--TotalAnnualSales: To holds the sales persons total sales in a year.

In addition, the class should have the following member functions.

--Constructor: The constructor should accept the sales persons data as arguments and assign these values to the objects member variables.

--Mutators: Appropriate mutator functions should be created to allow values to be set for each objects data members.

--Accessors: Appropriate accessor functions should be created to allow values to be retrieved from an objects data members.

--calculateCommission: This function should calculate and display the commission amount for a sales person based on his totalAnnualSales. See below

TotalAnnualSales Commission Percentage
Under $10,000 No commission
$10,000-$20,000 2% of TotalAnnualSales
Greater than $20,000 4% of TotalAnnualSales

Demonstrate the class in a program that creates a sales person object, and then calls each of the functions in the class.

--With the sales person class design in question #1 above in hand, write a program

--To have an array of sales person objects. The program should read and store information for each sales person in each of the object. It should then call a class function, once for each object, to display the sales persons ToalAnnualSales amount and commission amount.

--This program should use bubble sort to sort the array of sales person objects. It places sales person objects in ascending order by their first name.

--Demonstrate the binary search method in this program to search by first name.

Show your output and comments!

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

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions