SHARE
TWEET

07. Scholarship

MartinGeorgiev Nov 22nd, 2018 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $income = floatval(readline());
  4. $averageGrade = floatval(readline());
  5. $minSalary = floatval(readline());
  6.  
  7. $socialScholarship = floor($minSalary * 0.35);
  8. $excellentScholarship = floor($averageGrade * 25);
  9.  
  10. if (($averageGrade >= 5.50 && $excellentScholarship > $socialScholarship)
  11.     ||($income >= $minSalary && $averageGrade >= 5.50)) {
  12.     echo "You get a scholarship for excellent results $excellentScholarship BGN";
  13. } else if ($averageGrade >= 4.50 && $income < $minSalary) {
  14.     echo "You get a Social scholarship $socialScholarship BGN";
  15. } else {
  16.     echo "You cannot get a scholarship!";
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top