Create a class called commission the constructor of the


The ABC company offers its salesperson commission, based on two factors: the amount in sales, and the type of product they sell. There are two types of products, A and B. The salesperson receives 7% commission on product A if the sales is below $40,000.00, and 10% if the sales is $40,000.00 or more. A salesperson receives 5% commission on product B, if the sales is under$20,000.00 and 6.5% if the sales is $20,000.00 or more.

Create a class called Commission. The constructor of the class that accepts three parameters:

The salesperson's id

A single character representing the type of product, and

The sales amount.

Write:

A accessor method to validate the sales amount. That is, a negative amount cannot be compansated for.

A mutator method that calculates the commission amount. In writing this method use the switch statement to determine the type of product.

Solution Preview :

Prepared by a verified Expert
Business Management: Create a class called commission the constructor of the
Reference No:- TGS02510524

Now Priced at $10 (50% Discount)

Recommended (92%)

Rated (4.4/5)