Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $month = readline();
- $numberOfNights = intval(readline());
- $priceFlat = 0;
- $totalPriceFl = 0;
- $priceRoom = 0;
- $totalPriceRoom = 0;
- if ($month == "May" || $month == "October") {
- $priceRoom = 50;
- $priceFlat = 65;
- if ($numberOfNights > 7 && $numberOfNights <= 13) {
- $priceRoom = $priceRoom - ($priceRoom * 0.05);
- }
- if ($numberOfNights > 14) {
- $priceRoom = $priceRoom - ($priceRoom * 0.30);
- }
- } else if ($month == "June" || $month == "September") {
- $priceRoom = 75.20;
- $priceFlat = 68.70;
- if ($numberOfNights > 14) {
- $priceRoom = $priceRoom - ($priceRoom * 0.20);
- }
- } else if ($month == "July" || $month == "August") {
- $priceRoom = 76;
- $priceFlat = 77;
- }
- if ($numberOfNights > 14) {
- $priceFlat = $priceFlat - ($priceFlat * 0.10);
- }
- $totalPriceRoom = $numberOfNights * $priceRoom;
- $totalPriceFl = $numberOfNights * $priceFlat;
- printf("Apartment: %.2f lv.\n", $totalPriceFl);
- printf("Studio: %.2f lv.", $totalPriceRoom);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement