Answered step by step
Verified Expert Solution
Question
1 Approved Answer
codes req bakery items cost $9.99. 1) The bakery has a discount scheme depending on the number of bakery items purchased. For example, - If
codes req
bakery items cost $9.99. 1) The bakery has a discount scheme depending on the number of bakery items purchased. For example, - If between one to three bakery items are purchased, each costs the regular price of $9.99. - If between four to ten candies are purchased, the first three cost $9.99 and then the discount for the rest is 10%. - If 11 or more are purchased, the first three items cost $9.99 each, the discount for the next 8 candies ( 3 rd to 10th candies) is 10%, and that for the remaining candies ( 11th onwards) is 20%. - However, each order is restricted to only 50 bakery items, due to baking constraints, hence customers cannot order more than 50 items at a time. - Delivery is free for orders that cost more than $100. For orders less than $100, the cost of delivery is $10. - In-store pick-up is free. Hence, for example, if a customer orders 12 bakery items, the total due would be (39.99)+ 7(9.99(0.19.99))+2(9.99(0.29.99))=$108.90. Create a bakery order form that asks the customer for their name, address, the number of bakery items they would like to order and allows them to choose whether they would like to have the order picked-up or delivered. Placing an order should lead to a confirmation page which displays the following: The customer's full name and address The number of bakery items ordered The mode of delivery selected (delivery or pick-up) The subtotal due after applicable discounts are applied The total amount due after adding the subtotal from above, any delivery fees (if applicable) and an additional 10% sales tax, shown to 2 decimal places. Make sure to check for blank inputs or error inputs in the order form, and give appropriate error or warning messages in each case. The bakery wants all orders saved in a flat file. For each order, save the following information: The order date The customer name The total amount in the receipt The text file should be named "bakery.txt" and saved within your htdocs folder (inside the same subfolder the PHP script is in). Each of the above fields should be separated by semicolons. Each new order should be appended on a new line every time a customer submits the order form. Make sure to use appropriate open/close, lock/unlock functions and modes, and show error messages when needed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started