What would be the proper Javascript and HTML code for this school question?

World

New member
Ok here is my question I have asked this before, but now i worked on it, i have some coding but its still not working, what do i need to do to make it better
h
heres the question

I am working on coding for this assignment again. I know I am posting many here. I need feedback, was working for a few hours on this and so far not able to get it to work.

Here is the assignment questions


Develop a JavaScript program that will determine the gross pay for each of three employees. The company pays "straight time" for the first 40 hours worked by each employee and pays "time and a half" for all hours worked in excess of 40 hours. You are given a list of the company’s employees, the number of hours each employee worked last week, and the hourly wage paid to each employee.

Your program should input this information for each employee, determine the employee's gross pay, and output XHTML text that displays the employee's gross pay. Use prompt dialogs to input the data.


now here is my coding i have so far


<html>
<head>
<title>Hours worked for employees</title>
</head>
<body>
<h1>hours worked</h1>
<script type="text/javascript">




var name = prompt( 'Enter Name:', '');
var straightimeworked = 40;
var overtimehours = 10;

var hourlywage = '8.25';
var answer = straightimeworked + overtimehours + hourlywage;



for(var i=0; i<straightimeworked.length; i++) {
num = parseInt( prompt( 'how many of item '+(i+1),'0'));
if(!isNaN(num)) accumulator += items*num;
}
{
num = parseInt( prompt( 'how many regular hours worked this week '+(i+1),'0'));
num = parseInt( prompt( 'how many overtime hours worked this week '+(i+1),'0'));
document.write('The gross pay of employee "answer" is: ' + answer + '<br />');
}
</script>
</body>
</html>


please let me know what u think and what i need to use to improve
 
Back
Top