You will write a PHP program to calculate the payment receipt for renting a number of movies, using a conditional structure. Suppose that the rental rate depends on the number of movies rented by a customer at a time. There is a limit of renting a maximum of 20 movies at a time. Conditions: For the first 2 movies rented, the rate is $5.50/movie. For the next 2 movies rented, the rate is $4.25/movie. For the next 3 movies rented, the rate is $3.00/movie For any more movies rented (no more than 20), the rate is $2.00/movie. Hence, if a customer rents 5 movies, two of those will be rented at $5.50, two for $4.25 and one for $3.00, for a total of (2 * $5.50) + (2*$4.25) + $3.00 – $22.50. 1) Create a form that asks the customer for his/her name and the number of movies he/she would like to rent. On submit, display the total amount due (shown to 2 decimal places) on the same page. (15 points) 2) Save the customer’s submitted name in a flat file called “visitor.txt”. You should overwrite this name every time someone submits a name to the form. (10 points) Give appropriate error or warning messages for both 1) and 2). Show transcribed image text You will write a PHP program to calculate the payment receipt for renting a number of movies, using a conditional structure. Suppose that the rental rate depends on the number of movies rented by a customer at a time. There is a limit of renting a maximum of 20 movies at a time. Conditions: For the first 2 movies rented, the rate is $5.50/movie. For the next 2 movies rented, the rate is $4.25/movie. For the next 3 movies rented, the rate is $3.00/movie For any more movies rented (no more than 20), the rate is $2.00/movie. Hence, if a customer rents 5 movies, two of those will be rented at $5.50, two for $4.25 and one for $3.00, for a total of (2 * $5.50) + (2*$4.25) + $3.00 – $22.50. 1) Create a form that asks the customer for his/her name and the number of movies he/she would like to rent. On submit, display the total amount due (shown to 2 decimal places) on the same page. (15 points) 2) Save the customer’s submitted name in a flat file called “visitor.txt”. You should overwrite this name every time someone submits a name to the form. (10 points) Give appropriate error or warning messages for both 1) and 2).
Expert Answer
Answer to You will write a PHP program to calculate the payment receipt for renting a number of movies, using a conditional struct…