HW5.11

HW5.11

 public class Solution
 {
     public static void main(String[] args)
     {
         System.out.printf("%s\t%s\n", "Sales", "Prize");

         for(int i = 10000; i <= 100000; i += 5000)
             System.out.printf("%d\t%f\n", i, computeCommission(i * 1.0));
     }

     public static double computeCommission(double salesAmount)
     {
         double rate;

         if(salesAmount <= 5000)
             rate = 0.08;
         else if(salesAmount <= 10000)
             rate = 0.1;
         else
             rate = 0.12;

         return salesAmount * rate;
     }
 }
上一篇:IDE硬盘 SCSI硬盘 SATA硬盘


下一篇:HTML5中id可以用数字开头,但在css中不能正常使用