输入等级将显示相等的平均值

时间:2017-01-26 07:53:33

标签: php

我是PHP的新手,我会尝试输入会显示其等效的学生的成绩。

这相当于成绩:

1.00 (96-100); 
1.25 (93-95); 
1.50 (90-92);
1.75 (87-89); 
2.00 (84-86); 
2.25 (81-83); 
2.50 (78-80); 
2.75 (76-77);
3.00 (75); 
5.00 (Below 75);

这是我的代码:

<form method="POST">
    <td>
      <input type="text" id="someid" name="number" 
       maxlength="3" Onkeypress="return isNumberKey(event)" required />

<?php
   $number='';
   if (!empty($number)) {
        switch (true) {
            case $number>=96&& $number<=100:
                break;
            case $number>=93&& $number<=95:
                break;
            case $number>=90&& $number<=92:
                break;
            case $number>=87&& $number<=89:
                break;
            case $number>=84&& $number<=86:
                break;
            case $number>=81&& $number<=83:
                break;
            case $number>=78&& $number<=80:
                break;
            case $number>=76&& $number<=77:
                break;
            case $number>=75:
                break;
   }

?>

我的问题是我如何输入示例90的等级,使用PHP显示相当于90?

0 个答案:

没有答案