4. เลือกปฏิบัติ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 4-12  ส่วนของโปรแกรมแสดงขั้นตอนการตัดเกรด
 if ( score >= 80 ) {
   grade = "A";
 }
 if ((70 <= score) && (score < 80)) {
   grade = "B";
 }
 if ((60 <= score) && (score < 70)) {
   grade = "C";
 }
 if ((50 <= score) && (score < 60)) {
   grade = "D";
 }
 if ( score < 50 ) {
   grade = "F";
 }
©2009 S.Prasitjutrakul