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"

Product Cost Calculator

Room Information

";

print"

Room_NoBed_typePriceBook_it
11 king bed$89Book
21 qeen bed$60Book
32 king beds$170Book
42 qeen beds$110Book
";

print"

";

?>

bookroom.php

funA($_GET["room_no"], $_GET["price"], $_GET["how_long"]);

function funA($roomno, $priceinfo, $howlong)

{

print"

Greetings!

";

$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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!