Question: __ Write down the missing code according to the comments included in the code roominfo.php bookroom.php
__ Write down the missing code according to the comments included in the code
roominfo.php
print"
Room Information
";print"
| Room_No | Bed_type | Price | Book_it |
| 1 | 1 king bed | $89 | Book |
| 2 | 1 qeen bed | $60 | Book |
| 3 | 2 king beds | $170 | Book |
| 4 | 2 qeen beds | $110 | Book |
print"
";
?>
bookroom.php
funA($_GET["room_no"], $_GET["price"], $_GET["how_long"]);
function funA($roomno, $priceinfo, $howlong)
{
print"
$room_no=$roomno;
$price = $priceinfo;
$how_long=$howlong;
$total=$price*$how_long;
$disaccount=0;
if($total>260){$disaccount=30;}
elseif(($total<=260)&&($total>240)){$disaccount=25;}
elseif(($total<=240)&&($total>220)){$disaccount=20;}
elseif(($total<=220)&&($total>200)){$disaccount=15;}
elseif(($total<=200)&&($total>180)){$disaccount=10;}
else { $disaccount=0; }
$totalbefore=$price*$how_long;
$total = $price*$how_long*(1-($disaccount/100));
print"
- You will receive $disaccount% discount.
- Your total payment before discount is $totalbefore.
- Your total payment is $total.
print"
";
funB($room_no,$how_long,$price,$totalbefore, $disaccount);
}
function funB($room_no,$how_long,$price,$totalbefore, $disaccount)
{
/*
this function will perform the following operations:
(1)create a database having one table. The name and data type of each column of this table is below:
- room_no INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
- hong_long int,
- price double,
- beforecost double,
- disacoount double
(2) insert the data into the table, including room number, how many days to stay, the price, the cost before the discount is applied, the discount.
*/
}
?>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
