Question

In: Computer Science

Create a two-part form that calculates weekly income for Happy Diner's waitress Tammy, based on her...

Create a two-part form that calculates weekly income for Happy Diner's waitress Tammy, based on her regular hours, overtime pay, and tips. She makes $10 an hour, if she works 40 hours a week, or less. Her overtime pay is $15 an hour. If Tammy worked over 40 hours, she is earning her overtime wages. Happy customers give her tips as well.

Use an HTML document named tipsYourlastname.html as a Web form with two text boxes — one for the number of hours worked and one for the tips. Use a PHP document named tipsyourlastname.php as the form handler. Output the total amount earned to the screen in some nice organized manner. Please comment your code appropriately and test your program with various input to ensure it operates correctly. Check your math as well.

Please remember that program has to work to get credit.  This is a very small program, but you need to plan ahead and give yourself enough time for testing and debugging. Write a small piece of code at a time and test it before you add more code. Work incrementally.

Solutions

Expert Solution

PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU

//tipsYourlastname.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Hours Worked + Tips</title>

<meta http-equiv="Content-Type"

content="text/html; charset=iso-8859-1" />

</head>

<body>

<h1> Check Caluclations </h1>

<!-- Displaying the form that takes the number

of hours worked and tips recieved!-->

<form action= "tips.php" method= "get">

<p> Enter the number of hours worked</p>

<!-- input for the hours worked!-->

<input type="text" name="hours"/>

<p> Enter the amount of tips</p>

<!-- Input for tips made!-->

<input type= "text" name= "tips"/>

<p> <input type= "submit"/> </p>

</form>

</body>

</html>





//tipsyourlastname.php

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title> Check Results </title>

</head>

<body>

<h1> Check Results </h1>

<?php

//* using GET parameter to get the hours worked,tips and over time *//

$Hours =$_GET["hours"];

$Tips = $_GET["tips"];

$OverTime = $Hours-40;//deducting 40 from $Hours as it gives us the overtime.

// checking if the user input is valid if not Hours/Overtime equals to zero *//

if(is_numeric($Hours) && is_numeric($Tips)){

// checking if the user worked more than fourty hours*//

if ($Hours<=40)

{

// calculating if the hours and tips below fourty hours & storing it into a variable*//

$PayCheck = $Hours*10 + $Tips;// paycheck will be evaluated result of hours worked * 10 + tips

echo "<p> Amoumt pay: ".$PayCheck."</p>";

}

// If the hours are greater than fourty *//

if ($Hours > 40 )

{

//paycheck in this case will be the evaluation of addition of (hours worked - overtime * 10), (overtime*15) and tips

$PayCheck = (10 * ($Hours-$OverTime))+($OverTime*15) + $Tips;

echo "<p> Amount pay with over time is ".$PayCheck."</p> ";

}

}

else

{

//Invalid input of number of hours worked & over time *//

echo "Invalid input Numbers!";

}

?>
</body>
</html>

Related Solutions

Jane spends all of her $200 weekly income on two goods, X and Y. Her utility...
Jane spends all of her $200 weekly income on two goods, X and Y. Her utility function is given by U(X,Y) = 2XY, If the price of X = $4/ unit and the price of Y = $10 a unit, how much of Y should she buy?
ITP100 Project: Part 3 Create the pseudocode solution to a program that calculates the final score...
ITP100 Project: Part 3 Create the pseudocode solution to a program that calculates the final score and letter grade for one student. Please use the following grading system: 9 Homework Assignments – 100 points each 10 points 11 Quizzes – 100 points each 5 points 5 Projects – 100 points each 10 points 6 Discussion posts – 100 points each 10 points 4 Exams – 100 points each 65 points A = 90 – 100% B = 80 – 89%...
ITP100 Project: Part 3 Create the pseudocode solution to a program that calculates the final score...
ITP100 Project: Part 3 Create the pseudocode solution to a program that calculates the final score and letter grade for one student. Please use the following grading system: 9 Homework Assignments – 100 points each 10 points 11 Quizzes – 100 points each 5 points 5 Projects – 100 points each 10 points 6 Discussion posts – 100 points each 10 points 4 Exams – 100 points each 65 points A = 90 – 100% B = 80 – 89%...
A waitress reported $467 of tips to her employer last year. Two month after she filed...
A waitress reported $467 of tips to her employer last year. Two month after she filed her federal income tax return, she received a letter from the IRS informing her that she had earned $5,260 in tips rather than the $467 she reported and she now owed the government $1872.94 in back taxes. A. How is the IRS able to determine the amount of tips the waitress received? B. If the IRS is correct, is the waitress subject to a...
Part 2 Consider the budgeted income statement for Happy Turtles for the month ended 30 June...
Part 2 Consider the budgeted income statement for Happy Turtles for the month ended 30 June 2017 below:-                                                       $                     $ Sales                                               Less:   Cost of Goods Sold                             290,000             Inventory, 31 May 2017 50,000             Purchases                                        192,000             Available for sale                            242,000             Inventory, 30 June 2017 (40,000)                                                                                   202,000 Gross profit                                                                88,000 Less:   Operating...
Samantha earns a weekly income of $6000. Suppose she wishes to spend this income on two...
Samantha earns a weekly income of $6000. Suppose she wishes to spend this income on two goods books and dresses only. A book costs $200 while a dress costs $600. i. Draw Samantha’s budget line. Putting books on the Y axis. ii. Suppose her income increases to $9000 per week, illustrate what happens to her budget line. iii. Suppose the price of books increase to $600, while her income and the price of dresses is unchanged. Illustrate what happens to...
In deciding where to invest her retirement fund, an investor recorded the weekly returns of two...
In deciding where to invest her retirement fund, an investor recorded the weekly returns of two portfolios for one year, with the results stored in columns 1 and 2. Some of these data are shown below. Can we conclude at the 5% significance level that portfolio 2 is riskier than portfolio 1? Compare both return and risk . Do on Excel . This is the Data : Portflio-1 Portflio-2 0.22 0.32 0.59 0.35 0.11 0.48 -0.05 0.36 0.44 0.27 0.38...
Question 1 The binomial formula has two parts. The first part of the binomial formula calculates...
Question 1 The binomial formula has two parts. The first part of the binomial formula calculates the number of combinations of X successes. The second part of the binomial formula calculates the probability associated with the combination of success and failures. If N=4 and X=2, and p = .5, what is that probability from the second part of the formula? Group of answer choices .0625 .5 .3750 .1563 Question 2 Normal Distribution Problem. The birth weight is of newborn babies...
ISYS 350, Assignment 2, Part 1: Create a C# Form with a textbox and a button....
ISYS 350, Assignment 2, Part 1: Create a C# Form with a textbox and a button. The box is for a user to enter a number of seconds. And when the user clicks the button, the program displays the equivalent number of hours, minutes and seconds using a MessageBox. Show method. If the seconds entered is less than 60, your program should only display the seconds; if the seconds is a least 60 and less than 3600, your program should...
Cassandra invested one part of her $10,000 at 7.5% per year and the other part at 8.5% per year. Her income from the two investment was $820. How much did she invest at each rate?
Cassandra invested one part of her $10,000 at 7.5% per year and the other part at 8.5% per year. Her income from the two investment was $820. How much did she invest at each rate?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT