ช่วยดูทีครับ ผู้มีความรู้ทั้งหลาย

คือ อ. สั่งงานมาให้ผมทำแต่ผมอ่านแล้ว  ลองแล้วก็ทำไม่ได้ (ผมไม่เข้าใจ*-*)

Program demo6_4;
uses crt;
var  c : byte;
    s,t : real;
    na : string[30];
const line='====================================';
begin
    clrscr;
    Writeln(' *** Report Tax ***');
    Writeln(line);
    Write('Code='); readln(c);
    Write('Name='); readln(na);
    Write('Salary'); readln(s);
    If s > 50000 then t :=s*10/100
    Else if s >= 40000 then t:=s*8/100
    Else if s >= 30000 then t:=s*6/100
    Else if s >= 20000 then t:=s*4/100
    Else if s >= 10000 then t:=s*2/100
    Else t :=s*0/100;
    Write('Tax :=',t:10:2);
    Writeln(line);

End.

โจทร์  จากโปรแกรมนี้ จงเขียนขึ้นใหม่โดยใช้คำสั่ง case แทนคำสั้ง if

(ผมว่าผมพิมโปรแกรมถูกแล้วแต่มันก็รันแล้วตอบไม่ไป  กรุณาช่วยผมทีครับ)

 
🏷️ หัวข้อที่เกี่ยวข้อง
if