package com.yc.education.controller.admin;

/**
 * @program: gongshi
 * @description:
 * @author: hgueng
 * @create: 2019-12-11 15:09
 **/


public class UtilController {


    //折扣价
    public static double zhekou(double[] arr,int num,int[] array) {
        double a = 0;
        if(num < array[0]) {
            return 0;
        }
        if(num>=array[0]&&num<=array[1]) {
            a=arr[0];
            for(int i=array[0];i<num;i++) {
                a+=0.016;
            }
        }else if(num>array[1]&&num<=array[2]) {
            a=arr[1];
        }else if(num>array[2]&&num<=array[3]) {
            a=arr[2];
        }else if(num>array[3]&&num<=array[4]) {
            a=arr[3];
        }else if(num>array[4]&&num<=array[5]) {
            a=arr[4];
            System.out.println();
        }else {
            a=arr[5];
        }
        num--;
        return a+zhekou(arr,num,array);
    }

}
