Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ch78test;
- public class calcTax
- {
- public double order=0, tax=0, total=0;
- calcTax(double order)
- {
- this.order=order;
- }
- public double taxRate()
- {
- if(this.order<=1000000)this.tax=0.02;
- if(order>1000000&&order<5000000)tax=0.03;
- if(this.order>=5000000)this.tax=0.06;
- total=order+(order*tax);
- return total;
- }
- }
Add Comment
Please, Sign In to add comment