Question: 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




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: hwl_form.html and hwl_process.php. The file hwl_form.html provides a HTML form for a user to enter the package name and the hours used. After the user submits the form, hwl_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 hwl_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. Hints: Calculate costs for all three plans no matter which package the user uses. Save these costs for later cost comparison. Check your implementation using data in the sample output. Submission: 1. You should submit a ZIP file that includes two files named hwl_form.html and hwl_process.php on Blackboard by the due date. Do NOT use any other file names. 2. When you submit your work, in the submission comments area let me know if your program generates the same output as the four examples in the sample output. Sample Output: 1. hwl_form.html page launched BCS350 Assignment 1 -- Student Name 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. Enter your package and hours used: Package: Hours: 0 Calculate Monthly Charge 2. Invalid value(s) (Packaged and -60 minutes) processed BCS350 Assignment 1 -- Student Name The package you entered: d The hours you used: -60 Wrong package entered. Please return to the previous page and enter a valid package name. The amount of hours must be non-negative. Please return to the previous page and enter a valid value 3. Valid values (Package A and 400 minutes) processed - example 1 BCS350 Assignment 1 -- Student Name The package you entered: A The hours you used: 400 Your monthly charge is $99.95 By switching to Package B you would save $35.00. By switching to Package C you would save $60.00. 4. Valld values (Package B and 400 minutes) processed - example 2 BCS350 Assignment 1 -- Student Name The package you entered: B The hours you used: 400 Your monthly charge is $64.95. By switching to Package C you would save $25.00. 5. Valid values (Package B and 320 minutes) processed - example 3 BCS350 Assignment 1 -- Student Name The package you entered: B The hours you used: 320 Your monthly charge is $36.95. You chose the best package. 6. Valid values (Package Cand 250 minutes) processed - example 4 BCS350 Assignment 1 -- Student Name The package you entered: C The hours you used: 250 Your monthly charge is $39.95 By switching to Package B you would save $10.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
