This is the second part to my problem. i already have a MYutils to use .....i just need to know how to cod ethe calculate button. This is all on one form. If you have netbeans i have attatched what i have so far in a zip file. PLEASE HELP CODE THE Excercise 2 CALCULATE BUTTON. THANK YOU
. Implement a method called calcDiscount() that will accept the sales amount as a parameter and return the discount based on the following table values. Challenge option: Instead of using an if/else if selection structure, use parallel arrays with the amount and discount.
Amount
Discount
< $100
0
100 - 199
2%
200 - 499
5%
500 - 999
7%
$1000 or more
10%
4. Commissions are calculated based on the sales amount after any discount. Implement a method called calcCommission() that will accept the sales amount (after discount) as a parameter and return the commission based on the following table values. Challenge option: Instead of using an if/else if selection structure, use parallel arrays with the amount and discount.
Amount
Commission
< $200
2%
200 - 499
5%
500 - 999
7%
$1000 or more
10%
5. Implement a method called calcSalesTax() that will accept the sales amount (after discount) as a parameter and return the sales tax amount based on a 7.5% tax rate.
6. Implement a method called calcFinalPrice that will accept the sales amount, discount amount and tax amount as parameters and return the total price. [Total Price] = [Sales Amount] – [Discount] + [Sales Tax]. You will need to format the number to 2 decimal places and with a leading dollar sign (I.e., $300.00). See the Formatting Numbers in Java handout.
7. Test your code with the following amounts. Verify the correct discount, commission, sales tax and final price.
Sales Amount
Discount
Commission
Sales Tax
Total Price
99
0
1.98
7.43
106.43
199
3.98
3.90
14.63
209.65
499
24.95
23.70
35.55
509.60
999
69.93
65.03
69.68
998.75
1000
100
63
67.5
967.50