KeeganT

calcTax

May 1st, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. package ch78test;
  2.  
  3. public class calcTax
  4. {
  5.     public double order=0, tax=0, total=0;
  6.     calcTax(double order)
  7.     {
  8.         this.order=order;
  9.     }
  10.    
  11.     public double taxRate()
  12.     {
  13.         if(this.order<=1000000)this.tax=0.02;
  14.         if(order>1000000&&order<5000000)tax=0.03;
  15.         if(this.order>=5000000)this.tax=0.06;
  16.         total=order+(order*tax);
  17.         return total;
  18.     }
  19. }
Add Comment
Please, Sign In to add comment