请高手帮忙编写一个IF语句基准分5分,得分上限为基准分的130%,最低0分1.计划完成率在60%(不含)以下的,不得分;

1个回答

  • grade = 0

    if rate >= 0.6 and rate < 1 then

    grade = 5*rate*0.8

    elseif rate >=1 and rate < 1.1 then

    grade = 5*rate*1

    elseif rate >=1.1 then

    grade = 5*rate*1.1

    else

    grade = 0

    end if

    if grade >= 5*1.3 then

    grade = 5*1.3

    end if