Write PHP code to process data passed from HTML form; Write PHP statements to use PHP

variables, perform mathematical operations, and use control structures to solve application problems; Use
the echo construct and printf function to display output.
Tasks:
An Internet service provider has three different subscription packages for its customers:
Internet Service Packages
Package A: For $19.95 per month, 200 hours of access are provided. Additional hours are
$0.40 per hour.
Package B: For $29.95 per month, 300 hours of access are provided. Additional hours are
$0.35 per hour.
Package C: For $39.95 per month, unlimited access is provided.
Write a web application that allows the customer to enter the letter of the package the customer has
purchased (A, a, B, b, or C, c) and the number of hours that were used in a month, validates user input,
calculates and displays the monthly charge in the browser. It also displays the amount of money the
customer would save if a different package could be chosen.
Watch the video lecture and study code example order_form.html and order_process.php.
Create two files: hw1_form.html and hw1_process.php. The file hw1_form.html provides a
HTML form for a user to enter the package name and the hours used. After the user submits the form,
hw1_process.php processes the data as required.
The specification of the assignment includes the following:
1) Display the Internet Service Packages information to the customer.
2) Display an HTML form that allows the customer to enter the letter of package and the number of
hours used. Use 0 as a default value for the hours used.
3) After the form is submitted, display the customer’s input for the package name and hours used on
a new webpage.
4) Assume we don’t use JavaScript to validate user input on the client side, the validation must be
done on the server side in the hw1_process.php file.
If the customer enters a letter other than lowercase or uppercase letter of A, B, and C, display
“Wrong package entered. Please return to the previous page and enter a valid package name.” on
the webpage.
If the number of hours is negative, display “The number of hours must be non-negative. Please
return to the previous page and enter a valid value.” on the webpage.
5) Calculate the customer’s monthly charge and display it on the webpage. The currency should be
displayed with 2 decimal places as shown in the sample output. (Hints: Use the printf function.)
6) Display how much money the customer would save if he/she switches to other packages. If there
would be no savings by switching to other packages, display “You chose the best package.”.
7) Wherever possible, use named constants instead of numbers, for example, package base cost, free
hours for a package, and additional hour cost.
8) Use an HTML fieldset to display “BCS350 Assignment 1” followed by your name on the top of
both web pages. Please see sample output below. You are free to decide the styles of your pages.