Link Exchange
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
จากโจทย์ในเว็บ http://www.sourcecode.in.th/wbread.php?no=3523จงสร้างโปรแกรมตัดเกรด โดยที่0 - 49 "F">= 50 "D">= 60 "C">= 70 "B"80-100 "A"
/** * @Auther: Mr.Suppakit Thongdee * @Website: www.sourcecode.in.th * Oct 02, 2014 */ import java.util.Scanner; public class StudentGrade { public static void main(String[] args) { int iScore = 0; System.out.println("=====โปรแกรมตัดเกรด===="); System.out.print("ป้อนคะแนนนักศึกษา(0-100):"); Scanner in = new Scanner(System.in); iScore = in.nextInt(); System.out.print("เกรดที่ได้: "); if (iScore <= 49) { System.out.println("F"); } else if (iScore <= 59) { System.out.println("D"); } else if (iScore <= 69) { System.out.println("C"); } else if (iScore <= 79) { System.out.println("B"); } else if (iScore <= 100) { System.out.println("A"); } } }
Home - Article - Tutorial - Sourcecode - Dev Handbook - Search - WebBoard - Links - About Us