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.

Published on December 2017 | Categories: Graphic Art | Downloads: 74 | Comments: 0 | Views: 296
of x
Download PDF   Embed   Report

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.

Comments

Content

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.

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close