Advertisement
desislava_topuzakova

3. Aluminium Joinery

Apr 16th, 2018
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?php
  2.  
  3. $joineryCount = readline();
  4. $joineryType = readline();
  5. $delivery = readline();
  6.  
  7. $price = 0;
  8.  
  9. if ($joineryCount < 10) {
  10. echo("Invalid order");
  11. return;
  12. }
  13.  
  14. if ($joineryType=="90X130") {
  15. $price = 110;
  16. $price *= $joineryCount;
  17. if ($joineryCount > 60) {
  18. $price *= 0.92;
  19. } elseif ($joineryCount > 30) {
  20. $price *= 0.95;
  21. }
  22. } elseif ($joineryType=="100X150") {
  23. $price = 140;
  24. $price *= $joineryCount;
  25. if ($joineryCount > 80) {
  26. $price *= 0.90;
  27. } elseif ($joineryCount > 40) {
  28. $price *= 0.94;
  29. }
  30. } elseif ($joineryType=="130X180") {
  31. $price = 190;
  32. $price *= $joineryCount;
  33. if ($joineryCount > 50) {
  34. $price *= 0.88;
  35. } elseif ($joineryCount > 20) {
  36. $price *= 0.93;
  37. }
  38. } elseif ($joineryType=="200X300") {
  39. $price = 250;
  40. $price *= $joineryCount;
  41. if ($joineryCount > 50) {
  42. $price *= 0.86;
  43. } elseif ($joineryCount > 25) {
  44. $price *= 0.91;
  45. }
  46. }
  47.  
  48. if ($delivery=="With delivery") {
  49. $price += 60;
  50. }
  51.  
  52. if ($joineryCount >= 100) {
  53. $price *= 0.96;
  54. }
  55. printf("%.2f BGN", $price);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement