Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $joineryCount = readline();
- $joineryType = readline();
- $delivery = readline();
- $price = 0;
- if ($joineryCount < 10) {
- echo("Invalid order");
- return;
- }
- if ($joineryType=="90X130") {
- $price = 110;
- $price *= $joineryCount;
- if ($joineryCount > 60) {
- $price *= 0.92;
- } elseif ($joineryCount > 30) {
- $price *= 0.95;
- }
- } elseif ($joineryType=="100X150") {
- $price = 140;
- $price *= $joineryCount;
- if ($joineryCount > 80) {
- $price *= 0.90;
- } elseif ($joineryCount > 40) {
- $price *= 0.94;
- }
- } elseif ($joineryType=="130X180") {
- $price = 190;
- $price *= $joineryCount;
- if ($joineryCount > 50) {
- $price *= 0.88;
- } elseif ($joineryCount > 20) {
- $price *= 0.93;
- }
- } elseif ($joineryType=="200X300") {
- $price = 250;
- $price *= $joineryCount;
- if ($joineryCount > 50) {
- $price *= 0.86;
- } elseif ($joineryCount > 25) {
- $price *= 0.91;
- }
- }
- if ($delivery=="With delivery") {
- $price += 60;
- }
- if ($joineryCount >= 100) {
- $price *= 0.96;
- }
- printf("%.2f BGN", $price);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement