Documente Academic
Documente Profesional
Documente Cultură
6. Write the tag and closing tag that surround an entire HTML document.
19. Write a defining table for a program that calculates an employee's after-tax pay. Inputs include the
employee's regular hours worked, overtime hours worked, and regular hourly wage. Overtime hours
are paid at one and a half times the regular hourly wage. The employee's income is taxed at 18%. Your
output is the after-tax pay.
20. Write a JavaScript program to solve the problem from #19. You may use the following HTML code
if you wish:
<!DOCTYPE HTML>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Employee After-Tax Pay</title>
<script>
</script>
</head>
<body>
<h1>How much will this employee earn?</h1>
Regular Hours <input type="text" id="regularHours"><br>
Overtime Hours <input type="text" id="overtimeHours"><br>
Regular Hourly Wage <input type="text" id="hourlyWage"><br>
Employee's After-Tax Pay <div id="output"></div>
</body>
</html>
21. Write a defining table for a program that finds the length of the third side of a triangle using the law
of cosines. Input includes the length of two of the sides of the triangle (side1, side2) and the angle
between side1 and side2 (alpha). Your output is the length of the third side of the triangle. The law of
cosines is:
side 32 =side 12 +side 22 2side 1side 2cos ( alpha )
22. Write a JavaScript program to solve the problem from #21. You may wish to use the function
Math.cos . You may use the following HTML code if you wish:
<!DOCTYPE HTML>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Area of a triangle</title>
<script>
</script>
</head>
<body>
<h1>What is the length of the third side of a triangle?</h1>
Length of Side 1 <input type="text" id="side1"><br>
Length of Side 2 <input type="text" id="side2"><br>
Angle between sides <input type="text" id="alpha"><br>
Length of the third side of the triangle <div id="area"></div>
</body>
</html>