I'm trying to create a script that will calculate the tip a customer should pay, based on the number of customers and the amount of the bill. I also have to create an HTML document that has a form with two text boxes, one for number of customers and one foramount of bill(without tax and gratuity). 6 or more customers at a table is 18% gratuity, 5 or less at a table is 15% gratuity. I need to be able to print the gratuity amount to the screen.Also how much sales tax at 8.75% for bill? I need to display 4 amounts , the original amount, the sales tax amount, the gratuity amount and bill total including tax and gratuity. This is for a class that I'm in and I've been racking my brain on 2 or 3 problems. I was up most of last night trying to figure them out. I love this class and want to learn, but at some point I have to throw in the white flag. I appreciate your help! Just so you know, I'm doing this for a hobby as I'm almost 60 and retired from the Army in 2005. I really need a tutor. Thanks
This is what I have so far and it's not working in my PHP:
<?php
$customers = $_POST ['customers'];
$bill = $_POST ['bill'];
$tax = $_POST ['tax'];
while(customers >= 6) {
echo "$customers X $bill =", $bill .18, "<br>";
$customers++;
This is my HTML: I have 3 text boxes, Number of customers, Bill and NY Sales Tax and I also have a submit button that I named gratuity. Please help
burt.munn 0 Light Poster
milil 24 Newbie Poster
Bachu 45 Newbie Poster
burt.munn 0 Light Poster
matrixdevuk 71 6t9.me Founder
burt.munn 0 Light Poster
burt.munn 0 Light Poster
Bachu 45 Newbie Poster
burt.munn 0 Light Poster
cigoL..:) -1 Newbie Poster
burt.munn 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.