Advertisement
Guest User

Bonus score

a guest
Mar 24th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. <?php
  2.  
  3. $points = intval(readline());
  4. $Bonus = 0;
  5. if ($points <= 100) {
  6.     $Bonus = 5;
  7. } else if ($points > 100 && $points <= 1000) {
  8.     $Bonus = $points * 0.2;
  9. } else {
  10.     $Bonus = $points * 0.1;
  11. }
  12. if ($points % 2 == 0) {
  13.     $Bonus += 1;
  14. } else if ($Bonus % 10 === 5) {
  15.     $Bonus += 2;
  16. }
  17. echo $Bonus . PHP_EOL;
  18. Echo $Bonus + $points;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement