วันอาทิตย์ที่ 30 สิงหาคม พ.ศ. 2558

My grade.

void setup() {
  size(650, 500);
  background(#DD0000);
  fill(#FFFF00);
  textSize(30);
  float score = 95;

  cal_grade(score);
}
void cal_grade(float score) {
  float x = 250;
  float y = 350;

  if (score < 0) {

    text("Error", x, y);
    text("Error", x, y+100);
  } else if (score < 50) {

    text("F", x, y);
    text("-", x, y+100);
  } else if (score >= 50 && score < 55) {

    text("D", x, y);
    text("1.00", x, y+100);
  } else if (score >= 55 && score < 60) {

    text("D+", x, y);
    text("1.50", x, y+100);
  } else if (score >= 60 && score < 65) {

    text("C", x, y);
    text("2.00", x, y+100);
  } else if (score >= 65 && score < 70) {

    text("C+", x, y);
    text("2.50", x, y+100);
  } else if (score >= 70 && score < 75) {

    text("B", x, y);
    text("3.00", x, y+100);
  } else if (score >= 75 && score < 80) {

    text("B+", x, y);
    text("3.50", x, y+100);
  } else if (score >= 80 && score <= 100) {

    text("A", x, y);
    text("4.00", x, y+100);
  } else if (score > 100) {
    text("Error", x, y);
    text("Error", x, y+100);
  }
  text("Mr.Titi Rungruang (Cpr.E)", x-200, y-200);
  text("Computer Programming Fundamental", x-200, y-300);
  text("Your score = "+score, x-200, y-100);
  text("You get", x-200, y);
  text("GPAX", x-200, y+100);
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

Link Video Presentation Resort Managemant System Project.

Video Presentation Resort Managemant System Project. จัดทำโดย พากษ์เสียง: คุณาสิน  ทองมณี  5801012620011 ลำดับภาพ: สุพิชชา  ศรีศิริ...