পিএইচপি দিয়ে বাংলাদেশি জিপিএ ক্যাল্কুলেটরের যদি কোন টিউটোরিয়াল থাকে অথবা কোন স্ক্রিপ্ট থাকে তাহলে কেউ প্লীজ শেয়ার করেন।

asked 02 Aug '17, 07:17

anwarulislam's gravatar image

anwarulislam
91

1

I guess asking for a script goes against the rules. If you google properly you'll find a lot of tutorials.

(09 Aug '17, 17:45) ShawonAshraf

আমার মনে হয় এই ভাবে প্রশ্ন করে script ছাওয়া ঠিক না , তার পর অ আমি আপনাকে একটা demo কোড দিচ্ছি , you may find it helpful

<?php
$grade = 55 ;
if($grade >=33 && $grade<=40)
 echo "pass";
else if($grade >=40 && $grade<=50)
echo "D";
else if($grade >=50 && $grade<=60)
echo "C";
?>
permanent link

answered 18 Aug '17, 02:08

atikhashmee's gravatar image

atikhashmee
414

edited 18 Aug '17, 05:03

You may Use:

<?php

/ =====Grade calculator===== Author: Ali Kodor */

//example Grade_calculator::Set(82); //print_r(Grade_calculator::$output);

//Letter_grade echo 'Letter grade:'.Grade_calculator::$output['Letter_grade'].'
'; //Grade_point echo 'Grade point:'.Grade_calculator::$output['Grade_point'].'
'; //Class_interval echo 'Class interval:'.Grade_calculator::$output['Class_interval'].'
';

class Grade_calculator{ public static $output; public static function Set($grade){ if($grade<=32) static::$output=array( "Letter_grade"=>"F", "Grade_point"=>0, "Class_interval"=>"0–32" ); if($grade >=33 && $grade<=39) static::$output=array( "Letter_grade"=>"D", "Grade_point"=>1, "Class_interval"=>"33–39" ); else if($grade >=40 && $grade<=49) static::$output=array( "Letter_grade"=>"C", "Grade_point"=>2, "Class_interval"=>"40–49" ); else if($grade >=50 && $grade<=59) static::$output=array( "Letter_grade"=>"B", "Grade_point"=>3, "Class_interval"=>"50–59" ); else if($grade >=60 && $grade<=69) static::$output=array( "Letter_grade"=>"A-", "Grade_point"=>3.5, "Class_interval"=>"60–69" ); else if($grade >=70 && $grade<=79) static::$output=array( "Letter_grade"=>"A", "Grade_point"=>4, "Class_interval"=>"70–79" ); else if($grade >=80 && $grade<=100) static::$output=array( "Letter_grade"=>"A+", "Grade_point"=>5, "Class_interval"=>"80–100" ); } }

permanent link

answered 17 Apr, 11:36

Kodor%20Ali's gravatar image

Kodor Ali
16

<?php

/ =====Grade calculator===== Author: Ali Kodor */

//example Grade_calculator::Set(82); //print_r(Grade_calculator::$output);

//Letter_grade echo 'Letter grade:'.Grade_calculator::$output['Letter_grade'].'
'; //Grade_point echo 'Grade point:'.Grade_calculator::$output['Grade_point'].'
'; //Class_interval echo 'Class interval:'.Grade_calculator::$output['Class_interval'].'
';

class Grade_calculator{ public static $output; public static function Set($grade){ if($grade<=32) static::$output=array( "Letter_grade"=>"F", "Grade_point"=>0, "Class_interval"=>"0–32" ); if($grade >=33 && $grade<=39) static::$output=array( "Letter_grade"=>"D", "Grade_point"=>1, "Class_interval"=>"33–39" ); else if($grade >=40 && $grade<=49) static::$output=array( "Letter_grade"=>"C", "Grade_point"=>2, "Class_interval"=>"40–49" ); else if($grade >=50 && $grade<=59) static::$output=array( "Letter_grade"=>"B", "Grade_point"=>3, "Class_interval"=>"50–59" ); else if($grade >=60 && $grade<=69) static::$output=array( "Letter_grade"=>"A-", "Grade_point"=>3.5, "Class_interval"=>"60–69" ); else if($grade >=70 && $grade<=79) static::$output=array( "Letter_grade"=>"A", "Grade_point"=>4, "Class_interval"=>"70–79" ); else if($grade >=80 && $grade<=100) static::$output=array( "Letter_grade"=>"A+", "Grade_point"=>5, "Class_interval"=>"80–100" ); } }

permanent link

answered 17 Apr, 11:37

Kodor%20Ali's gravatar image

Kodor Ali
16

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×30
×1

question asked: 02 Aug '17, 07:17

question was seen: 460 times

last updated: 17 Apr, 11:37