Need Help with HTML/JavaScript Assigment (I'm new in HTML/JavaScript)

I need to finish this assignment:

Requirements:

-Use prompt dialog boxes for input.

-Get the user.s name.

-Get a 3 digit integer value from the user and convert it into an integer with the parseInt method.

-Calculate the number of hundreds in the integer.

-Calculate the number of tens in the integer.

-Calculate the number of ones in the integer.

-Output Programmed by Your Name, the user.s name, the number input and the number of hundreds, tens, and ones in the number. Use one line for each and be sure to label your output clearly.

This is what I've come up with so far, but I can't figure out the Calculate part of the code:

<html>

<head>

<title>Lab Assignment #4 CIS 111</title>

<script type = "text/javascript">

var name;

var integer;

name = window.prompt( "Please Enter Your Name:" );

integer = window.prompt( "Please A Three Digit Integer:" );

integer = parseInt( integer );

document.writeln( "<h1>This Was Programmed by Gerson Flores. The User's Name Is, " + name +

", The Three Digit Integer Entered By User Is: " + integer + "</h1>" );

</script>

</head>

<body>

<p>Click Refresh (or Reload) to run this script again.</p>

</body>

</html>

Any Help will be much appreciated!! Thanks!!